Improve beginMasterChanges and make methods for DeferredUpdates
* Fixed bug in LBFactory::beginMasterChanges where
untracked DBs that then get written to where not in the
transaction round. The call to onTransactionResolution()
right after commit() was also problematic, so a flag was
added to handle that.
* Add LBFactory::setWaitForReplicationListener(), which
fires at what is often a good point to run deferred updates.
* Add DatabaseBase::clearSnapshot() for committing no-op
transactions.
* Add IDatabase::setTransactionListener() for persistent
callbacks. Monitoring commits can be used to find a point
where deferred updates can run.
* Follow-up commit will address DeferredUpdates.
Change-Id: I4589e6f3ae40b1c362601416db48857fb89840bf