Revert "replace __sync_fetch_and_OP with __sync_OP_and_fetch"

This reverts commit 7c71f81495b74a24141df901dd5dc603db58cafd.
move definitions of ATOMIC_* to atomic_defs.h

* definitions of ATOMIC_* are taken from libshardcache
* ATOMIC_SET is patched to work with pointers
* ATOMIC_READ uses __sync_add_and_fetch (not __sync_fetch_and_add)
* ATOMIC_CMPXCHG renamed to ATOMIC_CAS