GSimpleAsyncResult: push thread context around callback
GSimpleAsyncResult: push thread context around callback

When an old pre-thread-default-context API that takes an explicit
GMainContext wants to call a gio API, it must call
g_main_context_push_thread_default() before, and
g_main_context_pop_thread_default() after the gio call, so that the
gio method will return its result to the desired GMainContext.

But this fails for methods like g_socket_client_connect_async() that
make a chain of multiple async calls, since the pushed/popped context
will only affect the initial call.

Fix this by having GSimpleAsyncResult itself push/pop the context
around the callback invocation, so that if the callback queues another
async request, it will stay in the same context as the original one.

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

pstglia/external-bluetooth-glib,lukasz-skalski/glib,01org/android-bluez-glib,ieei/glib,lukasz-skalski/glib,cention-sany/glib,pstglia/external-bluetooth-glib,MathieuDuponchelle/glib,cosimoc/glib,iConsole/Console-OS_external_bluetooth_glib,tchakabam/glib,01org/android-bluez-glib,endlessm/glib,cosimoc/glib,ieei/glib,zsx/glib,tchakabam/glib,mzabaluev/glib,johne53/MB3Glib,ieei/glib,iConsole/Console-OS_external_bluetooth_glib,tchakabam/glib,tamaskenez/glib,endlessm/glib,justinkb/aosp-bluez.glib,gale320/glib,johne53/MB3Glib,cosimoc/glib,endlessm/glib,antono/glib,djdeath/glib,Distrotech/glib,justinkb/aosp-bluez.glib,Distrotech/glib,tchakabam/glib,tamaskenez/glib,iConsole/Console-OS_external_bluetooth_glib,cention-sany/glib,bluez-android/glib,mzabaluev/glib,darren-clark/android_platform_external_bluetooth_glib,gale320/glib,zsx/glib,justinkb/aosp-bluez.glib,pstglia/platform-external-bluetooth-glib,bluez-android/glib,djdeath/glib,bluez-android/glib,johne53/MB3Glib,tamaskenez/glib,pstglia/platform-external-bluetooth-glib,johne53/MB3Glib,01org/android-bluez-glib,antono/glib,darren-clark/android_platform_external_bluetooth_glib,Distrotech/glib,cention-sany/glib,lukasz-skalski/glib,MathieuDuponchelle/glib,mzabaluev/glib,cosimoc/glib,endlessm/glib,MathieuDuponchelle/glib,johne53/MB3Glib,pstglia/platform-external-bluetooth-glib,darren-clark/android_platform_external_bluetooth_glib,justinkb/aosp-bluez.glib,tchakabam/glib,iConsole/Console-OS_external_bluetooth_glib,antono/glib,darren-clark/android_platform_external_bluetooth_glib,01org/android-bluez-glib,krichter722/glib,pstglia/platform-external-bluetooth-glib,cention-sany/glib,MathieuDuponchelle/glib,djdeath/glib,antono/glib,zsx/glib,djdeath/glib,cosimoc/glib,cention-sany/glib,ieei/glib,pstglia/external-bluetooth-glib,tamaskenez/glib,iConsole/Console-OS_external_bluetooth_glib,gale320/glib,Distrotech/glib,MathieuDuponchelle/glib,krichter722/glib,gale320/glib,bluez-android/glib,pstglia/platform-external-bluetooth-glib,mzabaluev/glib,mzabaluev/glib,krichter722/glib,darren-clark/android_platform_external_bluetooth_glib,lukasz-skalski/glib,endlessm/glib,pstglia/external-bluetooth-glib,01org/android-bluez-glib,tamaskenez/glib,zsx/glib,Distrotech/glib,gale320/glib,ieei/glib,krichter722/glib,bluez-android/glib,justinkb/aosp-bluez.glib,johne53/MB3Glib,djdeath/glib,krichter722/glib,pstglia/external-bluetooth-glib,lukasz-skalski/glib