tests: fix tests when compiling with glib_checks=disabled