mainloop-test: Fix uninitialized memory access in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711751
threadpool-test: Fix leaks in tests

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