Verify cache dir exists

In some cases, the cache dir might not be present post-compile. e.g. a buildpack removed the cache dir. This ensures the cache dir exists before doing anything with the directory.