Client memleaks

A bunch of memleaks in restraint client found by valgrind.