LIB: improve the performance of memcpy and memmove of the general version

the performance of memcpy and memmove of the general version is
very inefficient, this patch improved them.
Signed-off-by: Miao Xie <mi...@cn.fujitsu.com>