Fix database lock timeout