Prevent parallel archiving of same repo/ref/format.
Also extracted archive file path generation to a separate method that will be used by gitlab-rails to check if the archive already exists.
Related to private issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2173.