sqlalchemy: add retry on deadlock for delete_resource()
sqlalchemy: add retry on deadlock for delete_resource()

Deleting a resource can trigger a deadlock using PostgreSQL.

 oslo_db.exception.DBDeadlock: (psycopg2.extensions.TransactionRollbackError) deadlock detected
 DETAIL:  Process 91956 waits for RowExclusiveLock on relation 21454 of database 12641; blocked by process 91968.
 Process 91968 waits for ShareRowExclusiveLock on relation 21416 of database 12641; blocked by process 91956.
 HINT:  See server log for query details.
  [SQL: 'DELETE FROM resource WHERE resource.id = %(id_1)s'] [parameters: {'id_1': UUID('4b935d09-6aa6-4403-8f8c-a76628bfad60')}]

Change-Id: Ife5c3ae5fdf921f27a6ca964d82e99a4ae45aa0a

leandroreox/gnocchi,gnocchixyz/gnocchi,gnocchixyz/gnocchi,leandroreox/gnocchi,sileht/gnocchi,sileht/gnocchi