Using standard header stdlib.h instead of non-standard malloc.h

Reported by Luca Rigazio, thanks! Fixes #82 (compilations issues with
Mac OSX)