gmain: g_main_context_release should check context owner
When many threads use g_main_context_acquire to get the same g_main_context, only the owner of the g_main_context will add the owner_count. But all the g_main_context_release operations will reduce the owner_count. Although we should do g_main_context_release after g_main_context_acquire return true, it is better to check context owner before reducing owner count in g_main_context_release.