Handle SQLite LOCKED failures by retrying

This is probably the wrong way to do this, but I wanted to not
silently retry inside the SQLite code but instead allow all the users
of my SQLite stuff to decide what to do with retries themselves.  I
think it's a bad idea, though.