Trivial backport of !2449 (merged) and !2600 (merged) to glib-2-72, which should fix some test failures on mingw.
glib-2-72