RCA Merge requests getting closed inadvertently

<!--
**Please note:** if the incident relates to sensitive data, or is security related consider
labeling this issue with ~security and mark it confidential.
*** 
-->

Incident: gitlab-com/gl-infra/production#NNN

## Summary

Because of issue noted in https://gitlab.com/gitlab-com/gl-infra/production/issues/1039, some MR's had their source branches reported missing and the refresh service closed all MR's that it found with a reported missing source branch.

- Service(s) affected : ~"Service:Sidekiq" 

- Team attribution : 

- Minutes downtime or degradation : 

For calculating duration of event, use the [Platform Metrics Dashboard](https://dashboards.gitlab.net/d/ZUei7TkWz/platform-metrics?orgId=1) to look at appdex and SLO violations.

## Impact & Metrics

Start with the following:

- What was the impact of the incident?
  - a small number of MRs got closed inadvertently
- Who was impacted by this incident?
  - a small number of users (internal and external)
- How did the incident impact customers? 
  - MRs were closed which should have stayed open.
- How many attempts were made to access the impacted service/feature?
- How many customers were affected?
- How many customers tried to access the impacted service/feature?

Include any additional metrics that are of relevance.

Provide any relevant graphs that could help understand the impact of the incident and its dynamics.

## Detection & Response

Start with the following:

- How was the incident detected?
  - reports from users
- Did alarming work as expected?
  - there is no alarming for this kind of event
- How long did it take from the start of the incident to its detection?
- How long did it take from detection to remediation?
- Were there any issues with the response to the incident? (i.e. bastion host used to access the service was not available, relevant team memeber wasn't page-able, ...)

## Root Cause Analysis

Merge requests got closed unexpectedly.

1. Why? - MergeRequests::RefreshService closed some MRs.
2. Why? - Because their branches seemed missing.
3. Why? - The branch cache was not invalidated.
4. Why? - We killed `post_receive` jobs during incident https://gitlab.com/gitlab-com/gl-infra/production/issues/1039 which seems to have prevented branch invalidation in a few cases.
5. Why? - Because there is a possible race condition with branch invalidation (https://gitlab.com/gitlab-org/gitlab-ce/issues/65803)

## What went well

Start with the following:

- Identify the things that worked well or as expected.
- Any additional call-outs for what went particularly well.

## What can be improved

Start with the following:

- Using the root cause analysis, explain what can be improved to prevent this from happening again.
- Is there anything that could have been done to improve the detection or time to detection?
- Is there anything that could have been done to improve the response or time to response?
- Is there an existing issue that would have either prevented this incident or reduced the impact?
- Did we have any indication or beforehand knowledge that this incident might take place?

## Corrective actions

* [x] fix for MergeRequestWorker race condition https://gitlab.com/gitlab-org/gitlab-ce/issues/65803 

## Guidelines

* [Blameless RCA Guideline](https://about.gitlab.com/handbook/infrastructure/#rca)
* [5 whys](https://en.wikipedia.org/wiki/5_Whys)

Story points: 1.0