Add a cmake option for disabling usage of atomics.

Without this, if a platform has atomics support detected, there isn't
any simple way for a developer to disable them for debugging purposes.