Add implementations of atomic integer for GCC, MSVC and with locking.