HPCC-9626 - Clear up various issues spotted by valgrind

A few minor leaks and new/free mismatches

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>