Log Message: Fix build on FreeBSD 9-10: - malloc.h breaks actively on FreeBSD for a long time, use stdlib.h as suggested; - treat FreeBSD uniformly with other BSD systems.