Improved atomics API.

Made the atomic API compatible with std::atomic such that we
can easily substitute std::atomic when available. This API
also requires no change by the users of ReferenceCount.

Change-Id: I078c29d92fcee5fd444c0eb675bceca695c89667
Merge topic 'improved-atomic-api' into master

92f6db75 Improved atomics API.