Add implementations of atomic functions using gcc atomic ops. Not yet used.