gio: Prevent hang when finalizing GThreadedSocketService
gio: Prevent hang when finalizing GThreadedSocketService

If all users of a GThreadedSocketService release their references to the
service while a connection thread is running, the thread function will
release the last reference to the service which causes the finalize to
deadlock waiting for all threads to finish (because it's called from the
thread function).

To fix this, don't wait for all threads to finish in the service's
finalize method.  Since the threads hold a reference to the service,
finalize should only be called when all threads are finished running (or
have unrefed the service and are about to finish).

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

tamaskenez/glib,johne53/MB3Glib,MathieuDuponchelle/glib,lukasz-skalski/glib,johne53/MB3Glib,tamaskenez/glib,endlessm/glib,MathieuDuponchelle/glib,johne53/MB3Glib,Distrotech/glib,johne53/MB3Glib,ieei/glib,krichter722/glib,mzabaluev/glib,endlessm/glib,tamaskenez/glib,endlessm/glib,tchakabam/glib,cention-sany/glib,endlessm/glib,endlessm/glib,lukasz-skalski/glib,Distrotech/glib,Distrotech/glib,tchakabam/glib,tchakabam/glib,MathieuDuponchelle/glib,tchakabam/glib,gale320/glib,krichter722/glib,mzabaluev/glib,mzabaluev/glib,ieei/glib,Distrotech/glib,MathieuDuponchelle/glib,mzabaluev/glib,ieei/glib,MathieuDuponchelle/glib,gale320/glib,krichter722/glib,Distrotech/glib,tamaskenez/glib,cention-sany/glib,johne53/MB3Glib,lukasz-skalski/glib,tchakabam/glib,cention-sany/glib,tamaskenez/glib,krichter722/glib,mzabaluev/glib,johne53/MB3Glib,krichter722/glib,gale320/glib,gale320/glib,lukasz-skalski/glib,lukasz-skalski/glib,cention-sany/glib,gale320/glib,ieei/glib,ieei/glib,cention-sany/glib