Try reducing the time the lock is needed
It seems that mysql has issue deleting the project when the
pagure.exceptions.RepoExistsException is raised because of lock
timeout: Lock wait timeout exceeded; try restarting transaction
So we tried reducing the time the lock is needed by just locking
the part where it makes sense rather than the full function.
From our empirical tests it worked, future will tell if it
persists.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>