tests/connection-test: Ensure quit source id is reset to 0 between runs

Otherwise we may attempt to remove a nonexistent quit loop from the
previous one.  The second hunk here is the real fix, the first is just
being more defensive/consistent.

Reported-By: Kjartan Maraas <kmaraas@gnome.org>
Tested-By: Kjartan Maraas <kmaraas@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=711361
Don't leak g_get_current_dir() result

glib API documentation indicates:
« The returned string should be freed when no longer needed. »

https://bugzilla.gnome.org/show_bug.cgi?id=711085
socket: Don't leak GTasks

GTask needs to be unreffed after calling g_task_return_* when we
don't use async methods which take ownership of it (as
g_task_run_in_thread() does).

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