Declare exit handlers for SPs with transactions

We also need to resignal the error back to the client since
otherwise the ROLLBACK consumes/masks the error and the client
thinks everything was okay.