fixed hash cache file handling Exceptions

https://github.com/saltstack/salt/issues/10878