Fixes Memory Leaks

Fixes all the memory leaks in the test bench. At the beginning I did
not care much about it, but now that the QA is executed under valgrind
it does make sense to keep it clean and tidy so the real memory leaks
in libchula can be spotted easily.