ensure CacheDir and LogDir exist as dirs