tests: Fix some minor leaks in the unit tests

https://bugzilla.gnome.org/show_bug.cgi?id=737446