support for creation of cache file directory. Fixes issue with Ubuntu 12.04 once malloc is not used.