berkeley_db.c: improvements to transactional data store
https://docs.oracle.com/cd/E17276_01/html/programmer_reference/transapp_env_open.html
The use of the DB_RECOVER flag to dbenv->open() appears to do more than just try to
recover the environment upon startup. It also creates __db.00X files, which are
perhaps holding the environment??? In any case it seems to be more solid this way.
I am also removing the use of any "private" transactions, since they are no longer
needed. Operations which write to the database check to see if the thread's dedicated
transaction pointer is in effect, maintaining that transaction if it is, and creating
a transaction in the same pointer otherwise.
There is a "double free" bug somewhere in here and I'm still trying to figure out what
conditions cause it to happen.