Fix head pipeline stored in merge request for external pipelines (!12478) · Merge Requests · GitLab.org / GitLab Community Edition

## What does this MR do? Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/34130#note_33397067. We introduced `head_pipeline` as a value of `merge_requests`. This is however not updated when external pipeline is created. Thus this leads to...