lib: don't use kernel's memcpy and memmove

Change-Id: If7256034ad27e74e1a963cc66f7987d571316f68
Signed-off-by: zwliew <zhaoweiliew@gmail.com>