Merge pull request #606 from tomjenkinson/master

JBTM-1702 Make sure to return an exception to the user if xa_end fails