gio: Prevent hang when finalizing GThreadedSocketService