Add a compat stdatomic.h implementation based on pthreads