fixes for 6 problems that some compilers will have with the code

The most important commit is "memmove is expected to return dest" because if HAVE_MEMCPY is not defined memcpy will also not return and this returnvalue is used in utils.c