Submitted by Colin Walters
I'm trying to use
-fsanitize=thread for OSTree, and some of
these issues seem to go into GLib. Also, the sanitizers work better if
the userspace libraries are built with them too.
Mixing atomic and non-atomic reads trips TSAN, so let's change the assertions to operate on the local values returned from atomic read/writes.
Without this change I couldn't even build GLib with TSAN, since we use gresources during compilation, which uses GSubprocess, which hits this code.