Stop uses of database before closing db.
Stop uses of database before closing db.

Since the stop RPC and ^C interrupt handling now shutdown the process
using the same code path, the closeDB callback needs to stop any
remaining uses of the database before closing the DB.

This should prevent any database corruption issues that may happen
during clean shutdown, but unclean shutdown can still corrupt the
database since not all operations that should be atomic actually are.

jrick/dcrwallet,jrick/dcrwallet,decred/dcrwallet,jrick/btcwallet,decred/dcrwallet,jrick/btcwallet