Reorganize code to use only 32bit atomic ops for 32bit platforms.

32bit PowerPC for example lacks 64bit CAS.