Rollback to autocommit, except for sequence  iteration

Keeping the transaction active for the entire request increases the
likelihood of a deadlock on Galera clusters.
Merge pull request #1424 from greezybacon/issue/cluster-deadlocks

Rollback to auto commit, except for sequence  iteration

Reviewed-By: Peter Rotich <peter@osticket.com>