Fix compilation on OS X and other systems without <malloc.h>

All required declarations are in <stdlib.h>