Make PostReceive#perform idempotent

As reported in https://gitlab.com/gitlab-org/gitlab-ce/issues/33690, since events are created in the PostReceive worker, if the job fails, duplicate events could be created.

We should improve that by making PostReceive#perform idempotently so that we don't create duplicate events.

Edited by Nick Thomas