Changed dbfile:cautious-open-database to use most of the code from db:lock-create-open