only commit in case a transaction is active
Merge pull request #9809 from owncloud/check-transaction-before-commit-migration-master

only commit in case a transaction is active