Regain non-threadsafe builds and make the valgrind build failable

The valgrind change should make it faster to get feedback on the builds.

The other one makes sure we are actually testing the non-threadsafe code.