test: plug a couple of memory leaks

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>