Prevent exceptions swallowing by rails in test env

By default Rails swallows exception in after_{commit/rollback} hooks,
therefore prevent specs to fail.
By moving the callbacks inside the transaction in test environment any
exceptions thrown will correctly be bubbled up.

There is an option to fix that in rails 4.2
https://github.com/rails/rails/pull/16537