Use begin_transaction if connection responds to it

Supports ActiveRecord-4.0.0.beta1