A non blocking ring buffer in C