Ensures cache directory exists for testing