Allow specifying dbtx in TxnBegin.

Optionally allow specifying an existing DbTxn to use in TxnBegin of the
DBs, so that one can use an atomic transaction across multiple databases
to fix syncing issues in the future.
Update support for reusing DbTxn's across DBs.

Implement better support for reusing database transactions to
synchronise multiple DBs with TxnBegin(parent-txn).  Keep track of which
transactions are our own, and only abort/commit those.
Fix handling of return value in TxnCommit/TxnAbort.

In the changes introduced to TxnCommit/TxnAbort due to ownTxn, the
return value was ignored so far due to an oversight.  Correct this.
Allow specifying dbtx in TxnBegin.

Optionally allow specifying an existing DbTxn to use in TxnBegin of the
DBs, so that one can use an atomic transaction across multiple databases
to fix syncing issues in the future.
Move CNameDB to db.h.

Move the CNameDB class to db.h and move the definition of vchType to
headers.  Fix the includes in other files so that everything compiles.
Add DatabaseSet wrapper class and use it.

Introduce a new class DatabaseSet that wraps around the "blockchain
status databases" CTxDB and CNameDB.  Use it instead of the classes
themselves for blockchain validation.  The only net effect this has is
that CNameDB is not created/destroyed in each Connect/DisconnectInputs
hook, but at the same time as the CTxDB.  It possibly also fixes syncing
between both with atomic transactions.
Properly create nameindex database when it not exists.

Ensure that the nameindex database is created before loading the block
index when it does not yet exist, otherwise using DatabaseSet fails.
Fix GameStepValidator's setting of fOwnDb.
Merge pull request #41 from domob1812/db-updater

Port database class from Namecoin