Backport disabling transactions in migrations

Rails 4 has support for disabling transactions in migrations.  This is a backport of that commit.