Various atomics fixes for gcc/clang.

Make atomicInc/atomicDec work with clang, too; also, actually import
the memory model constants from C rather than relying on the enum
matching the C constants by happenstance.
Merge pull request #1608 from rbehrends/fix-atomics

Various atomics fixes for gcc/clang.