gmain: make g_source_add_child_source() thread safe
gmain: make g_source_add_child_source() thread safe

g_source_add_child_source() releases the context lock before attaching
child_source to context. And this causes trouble if parent source is
blocked and g_main_dispatch() manages to lock the context mutex and call
unblock_source() before child_source gets attached to context.
To fix this we call g_source_attach_unlocked() before releasing the
context mutex.

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

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