Reduced memory leak problem in transactions by lazily updating AR objects with new transaction state. If AR object has a callback, the callback will be performed immediately (non-lazily) so the transaction still has to keep records with callbacks.
Merge pull request #9068 from wangjohn/transaction_callback_patch

Reduced memory leak problem in transactions by lazily updating AR objects