Fix bug when pdflatex claims a directory as an input file

In some cases, pdflatex may claim that a directory is an input file in
the file recorder log.  Previously, this caused an uncaught exception
in the HashCache.  Catch and handle this exception.