active_merchant: ActiveRecord workarounds

Under high load and concurrency, we sometimes encountered bugs in the
ActiveRecord stack. This implements workarounds.

See also 4de2637150573500564c81394edf637321d718eb.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>