Remove shard ID and unstable suffix when comparing failed job names with the base commit (#104821)
Fixes https://github.com/pytorch/test-infra/issues/4328
This goes together with https://github.com/pytorch/test-infra/pull/4353 and it updates `trymerge` to remove shard ID and the `unstable` suffix when comparing failed job names with the base commit.
### Testing
Add unit tests with the reported issue as a test case https://github.com/pytorch/pytorch/pull/104214 to make sure that the failure there is reported as ignorable broken trunk instead of a new failure.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/104821
Approved by: https://github.com/malfet