Use begin_transaction if connection responds to it (AR 4)

Supports ActiveRecord-4.0.0.beta1

Fixes #188 and #187.
Based on the suggestion from @sjmadsen in #187.

I have not run the full test suite successfully (don't have everything set up), so let's see what travis says.