HPCC-9099 Fix a few leaks in exception handling code

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #4202 from ghalliday/issue9099

HPCC-9099 Fix a few leaks in exception handling code

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>