Check for a locked database