[Database] Fixed case where trx idle callbacks might be lost.
- (bug 41656) LoadBalancer always commits if there are callbacks pending. This works by checking a new DatabaseBase::writesOrCallbacksPending() function.
- Made transaction idle callbacks run in autocommit mode. Generally callers already want autocommit mode or do quick begin()/commit() calls anyway. The docs already state that callbacks should close any connections they start, but this makes it harder for people to forget about implicit transactions. Since the callbacks often may happen in commitMasterChanges(), if transactions are left open, they might not get committed by anything afterwards.
- Added sanity exceptions and warnings if callbacks get lost for some reason.
- Renamed trxIdleCallbacks -> mTrxIdleCallbacks for consistency.