run db: Log db retries and operation being tried.

@dpmatthews has suggested it would be useful to know when a database retry has occurred for purposes of debugging.

This adds a warning message to the error logs when a retry of writing to the database occurs (much the same as when a INSERT becomes INSERT or REPLACE). As this shouldn't be happening as a regular thing it shouldn't pollute the logs but will allow us to see whether, in situations when a db lock *does* shut down the db, the problem is ongoing, causing the odd retry here and there, or if it is a single bad event.