Use proper atomics for the lockless ringbuffer