[Bug 373149] Backport glib performance patches