fix malloc.h define issues

malloc.h is considered a deprecated header and should only be used if
USE_STDLIB_H is not defined in config.h.  Since OSX has no malloc.h it
exposed these issues.