Cleaned up and fixed 64 bit atomic handling.

The logic for which 32 bit OS has an atomic operation is somewhat
complex and was breaking on PPC Apples. Hopefully, this fixes it
and cleans the code a bit.

Change-Id: Ie288b732e2bb47c9fc90f3621d852e784ec52ff1
Merge topic 'atomics-64bit-fix' into master

7a6d18a1 Cleaned up and fixed 64 bit atomic handling.