py: Use memmove instead of memcpy when appropriate.

Found this bug by running unix/ tests with DEBUG=1 enabled when
compiling.