Revert "Merge pull request #6226 from gnufied/master"

This reverts commit 9bf1a0db4acbbf9e8e6f707250269185224e7efe, reversing
changes made to fed97091b9546d369a240d10b184793d49247dd3.

Conflicts:
	activerecord/test/cases/transaction_callbacks_test.rb

Reason: This fix introduces another issue described at #8937, so we are
reverting it to restore the behavior of 3-2-stable.

We will fix both issues when we come out with a better solution