Use atomics in __cxa_guard functions
Use atomics in __cxa_guard functions

Similar to SingletonPtr, use atomic accesses when loading the guard word
outside the lock, and when storing, to ensure no races for threads that
don't take the lock.

Lack of atomics unlikely to be a problem in current builds, but code
could conceivably be subject to reordering if link-time optimisation was
enabled.

andcor02/mbed-os,mbedmicro/mbed,andcor02/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,mbedmicro/mbed,kjbracey-arm/mbed,andcor02/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,andcor02/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,andcor02/mbed-os,andcor02/mbed-os