sh: move xchg_cmpxchg to a header by itself