Retry queries on deadlock errors from InnoDB row-level locking (MySQL)