Fix function name in Database.open()
Make the lock re-entrant