Clean up some memleaks in tests

Trying to get the noise from valgrind down.

(Valgrind's shaky on my Mac, so I want to let travis grind on this because I think there's more that I'm missing...)