Revert "removing atomic"

This reverts commit 3a64796be1392031b58086567043a4b5b8111d07.
Added hack for ancient gcc compilers without proper C++11

Change-Id: I0ace99065432c4e9b90a727065ab4d842fa12fd8
Reviewed-on: http://review.couchbase.org/40899
Reviewed-by: Nimish Gupta <nimish@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>