X86 codegen: make LOCK a real instruction prefix

Before LOCK was a separate instruction and this led to the register
allocator separating it from the instruction it was supposed to be a
prefix of, leading to illegal assembly such as

    lock mov

Fix contributed by PÁLI Gábor János.
Fix test for fetchNandIntArray#

The test was incorrectly testing that NAND is associative, which it
isn't.
Add missing memory fence to atomicWriteIntArray#