Support gcc47 atomics

yep. Exactly what it says.
Yeah, I can't figure out the volatile thing either. Not clear how it can ever work correctly.