Add distro name check to caching task.

Adds an extra check to ensure the incorrect DISTRO_NAME
isn't passed into the caching task.