Fix for proper compilation on OSX

The malloc.h is probably too old/deprecated. Though still present at a different location in OSX, since stdlib.h includes the functions it provides, better to just switch to stdlib.h.