Fix test case: remove references to deprecated invert mask operation
Fix issue #1: Emit atomic loads

From ADonut: C++ static initializers need a guard variable, the guard is loaded atomically. Patch also fixes compilation with asserts enabled.