(Fixes core dump in rpl_failed_optimize.test) Ensure we end active transcations if we do an admin command (like optimize, repair etc)
This includes both code and test cases.