meson: Update the pthread feature checks
meson: Update the pthread feature checks

For GNU extensions, we need to define _GNU_SOURCE; but, more
importantly, we need to tell Meson to use the threadlib dependency when
compiling and linking the feature check.

This currently exposes a bug in Meson; see:

https://github.com/mesonbuild/meson/issues/2165

But once that's fixed, the check will work as intended.

https://bugzilla.gnome.org/show_bug.cgi?id=785955

endlessm/glib,johne53/MB3Glib,endlessm/glib,endlessm/glib,johne53/MB3Glib,johne53/MB3Glib,johne53/MB3Glib,johne53/MB3Glib,johne53/MB3Glib,endlessm/glib,endlessm/glib