thread.h: add atomic_exchange for int and long long