Add an atomic_flag implementation

This tries to mimic std::atomic_flag.  It builds on Windows/Android at least, but no idea if it builds on Symbian/Blackberry.

Should allow for easier atomic locks.

-[Unknown]