fix nested after_commit callbacks

Hey, hopefully this all checks out. All the tests pass, and I pored through the AR 3.2 and 4.1 code to make sure I understand all the angles, but this is really complex code, and I worry that I might have inadvertently broken something that doesn't have a test.

For what it's worth, with this change we have a very large rails 3.2 test suite that can now pass using this gem, rather than some silly AR monkey patching it did directly before.