ringbuffer/circular queue in c