Transaction aborted on slave should be retries. The OPTION_BEGIN bit was cleared prematurely. Removed dependence of code on value of OPTION_BEGIN bit when executing retries.
For this particular bug report it was rpl_loadfile.test that did not make proper cleanup, but the patch includes fixes for other tests aswell.