fix bug in ring_buffer:rotate()

ffi.copy does not necessarily handle overlapping memory, so use memmove instead.