Replace arch specific atomic.h with global atomic.h header using either stdatomic, __atomic or __sync primitives