fixes #851 Create a transaction after acquiring the lock so replication
step-down doesn't abort a transaction object still on the stack.