build: fix/remove calls to deprecated glib functions

Combining -Werror with a new glib results in needless failures over
deprecated function warnings. Some functions are already deprecated in
our current glib version (2.32) but didn't yet trigger an error. We can
safely go ahead and drop those calls, all are thread related. There is
one function that wasn't deprecated until 2.36 so we cannot remove it
safely. To allow building with newer versions disable -Werror for
deprecation warnings.