Fix some leaks in the checkpoint tester found by valgrind.