ringbuffer: use atomic ops on ringbuffer chunk magic
The ringbuffer protocol uses the chunk magic number to indicate to the
other side what state a chunk is in. It's therefore important to use
strongly ordered memory writes to make sure that neither the compiler
nor the CPU change the apparent order of the writes, since that would
result in corrupted messages.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>