Fix extern C wrapping glib headers
extern C was wrapping the includes of headers which in turn included glib.h. glib 2.84 started to include C++ code in some of its headers which breaks when wrapped with extern C, see https://gitlab.gnome.org/GNOME/glib/-/issues/3631
Fix by only wrapping our own code with extern C.
Fixes #5615 (closed)