Use ifdef HAVE_MALLOC_H to fix compile under MAC OS X

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Merge pull request #2 from jaalto/malloc

Use ifdef HAVE_MALLOC_H to fix compile under MAC OS X