[RFC] Add missing function attributes to functions in memory.h #806

Hi, 

This fixes issue #806. Any feedback or suggestions would  be greatly appreciated. 

Thanks!
`len` can be 0 (`xmallocz` allocates `len + 1` bytes). Will `FUNC_ATTR_NONNULL_ALL` disallow `len` 0? This is not desired.