Avoid hard-dep on bleeding-edge GLib

If new test api is not available, do without it. In this
case, the tests won't work installed, but they should still
work uninstalled and in distcheck.