Replace a deprecated API: g_main_iteration() with g_main_context_iteration().