Add debugging code and switch to std atomic.
Merge branch 'guard' of https://github.com/STEllAR-GROUP/hpx into guard