Added a few more trx sanity checks to DatabaseBase

* Also track the caller that added the callbacks

Change-Id: Idc4d9e4a89fcee28bd4b18ad6d8c6b09b9fe7e75
Merge "Added a few more trx sanity checks to DatabaseBase"