Two-step merge is not merged automatically
### Summary
I tried to merge a branch into master, then production. The second step was not performed automatically
### Steps to reproduce
1. Branch "cool-feature" with all CI builds passing
2. Create merge request gitlab-ce!1 to merge "cool-feature" into "master"
* Automatically merge when build succeeds is ticked
* Remove source branch
3. While CI build for 2. is still running, create merge request gitlab-ce!2 to merge "master" into "production"
4. Accept merge request gitlab-ce!2
5. Build succeeds
### Expected behavior
6. Branch "cool-feature" is removed
7. Commits from branch "cool-feature" should be in "master"
8. Commits from both "master" and "cool-feature" should be in "production"
### Actual behaviour
6. Branch "cool-feature" is removed
7. Commits from branch "cool-feature" are in "master"
8. Merge request gitlab-ce!2 is now hanging in mid-air, nothing happens (see screenshot)
### Relevant logs and/or screenshots

### Output of checks
#### Results of GitLab application Check
I decline to paste the output of
`sudo gitlab-rake gitlab:check SANITIZE=true`
because it outputs the LDAP DN for all users. I think the "sanitize" option is broken.
Everything else is fine, though.
#### Results of GitLab environment info
```
System information
System: RedHatEnterpriseServer 7.2
Current User: git
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.6.6
Bundler Version:2.3.0
Rake Version: 10.5.0
Sidekiq Version:4.1.4
GitLab information
Version: 8.11.2
Revision: e618ce2
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://gitlab.hq.stgt.etes.de
HTTP Clone URL: http://gitlab.hq.stgt.etes.de/some-group/some-project.git
SSH Clone URL: git@gitlab.hq.stgt.etes.de:some-group/some-project.git
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 3.4.0
Repository storage paths:
- default: /storage-sata/usr/share/git/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
```
issue