use memmove instead of memcpy

memmove is as fast as memcpy when there is no overlapping, and appears
to have smaller overhead when size is small.

This is possible that memcpy has some housekeeping in case the buffer
does overlap, while memmove merely does a dispatch in that case

This behavior appears on OS X