Fixed namespace of mutex locks.
When using armcc, fallback to the custom duration and timepoint implementation.
Added tests for atomic_flag.