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

All required declarations are in <stdlib.h>