Replace deprecated malloc.h with proper stdlib.h

For example, FreeBSD is sensitive to this and refuses to compile project with malloc.h included.