Move warning check in `get_cache_path` to follow directory creation. Fixes #375.

--HG--
branch : distribute
Merge another fix for regressions brought about by #375.

--HG--
branch : distribute