Can not delete images if db deadlock occurs

Glance api returns 500 Internal Server Error, if db deadlock occurs
in glance-registry for some reason while deleting an image.

Added retry on image_destroy when db deadlock occures which will again
try to delete the image from database.

Closes-bug: 1378215
Change-Id: Ifad403e363daf368e846b5b6838432a7bedbe81a
(cherry picked from commit dae0fa8f1071be41d5541e9a5254abea48f5ba36)