Fix error when clearing FileCache.

I made a mistake in a previous commit that did not account for dir()
returning directory names.