fix up compress.h

so that it can be used with c++ more conveniently
use copy loops instead of memcpy/memmove

because different versions of gcc seem to disagree on how both of these
functions should handle overlapping memory. thanks stallman