crypto/threads_pthread.c: refactor all atomics fallbacks for type safety