Add --enable-malloc-logging configure option and update log.c to match.