Fix the merge notification email not being sent

The 'author_id_of_changes' attribute is not persisted in the database.
As we retrieve the merge request from the DB just before sending the
email, this attribute was always nil.

Also there was no tests for the merge notification code - tests have
been added.

Fix #6605
Merge pull request #6606 from kemenaran/fix-merge-notifications

Fix the merge notification email not being sent