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