Simple mutex implementation using cmpxchg