build: move glib detection and workarounds to meson