Add a few more error messages to db locking

This could be useful when things don't work as expected. STDERR only.
(cherry picked from commit 2b5fd35dafe0e165c740cba1163588061e716fdd)