Extract atomic_int into its own header/implementation file, tpie/atomic.h/cpp.

Cherry-picked from the snappy branch.