Use smart_malloc instead of malloc

Use smart_malloc instead of malloc to get allocation for HHVM request life. This is roughly synonymous with PHP's emalloc allocation function as exhibited by https://github.com/facebook/hhvm/blob/master/hphp/runtime/ext/fileinfo/libmagic/compat.h#L32