Fix arbitrary memory leaks in merge and split test harnesses

Close memory leaks in files specified by @jmarshall in response to #194.