Use C++ atomics if available for spinlock

Change-Id: I6b707f168b399015523926d3e7eb93aca382f497
Reviewed-on: http://review.couchbase.org/31331
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>