Limit SQLite busy-wait for a lock

The previous busy-wait could cause flood of the kernel with a lock
request, with basically no outer limit. This change adds a 15 seconds
time limit with a 100 ms delay between each lock request.