Allow overriding of delegate in thread-local data manager and fixed transaction handling in resource manager.

Change-Id: Ic196f0531288c098ec5218e52694a6235817dc6e