Fix a bunch of leaks
The test suite now has no leaks!
==13067== LEAK SUMMARY:
==13067== definitely lost: 0 bytes in 0 blocks
==13067== indirectly lost: 0 bytes in 0 blocks
==13067== possibly lost: 0 bytes in 0 blocks
==13067== still reachable: 59,939 bytes in 495 blocks
==13067== suppressed: 0 bytes in 0 blocks