Revert "Fix compilation on compilers which do not have Atomic built-in"
This reverts commit c2ea92c55535f00cf72661680e1ee8fb10116d74.
Reverting for now because it causes problems on macos and freebsd.