fix build problem on platforms without atomic instructions

Thanks to Michael Biebl for his very helpful analysis of the bug.
remove a couple of gcc --pedantic messages