Retry 3 times to log the action in the DB before bailing.
This fixes an error that occurred recently on pagure over dist-git where
suddenly we ran into a ``(TransactionRollbackError) deadlock detected``
error.
When this occurs, we will try to wait a little bit and come back to try
logging the action, two times (meaning we tried three times to log the
action).
After this, we'll just bail and raise the error.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>