Fix testsuite hangs on MySQL and PostgreSQL due to uncommited transactio...

...ns