Add ccache collection iteration for DIR:: caches

When we attempt to traverse a directory-based ccache collection with a
name of the form DIR::residual, instead of just bailing out as we did in
the past, proceed, treating the file named by the residual as we would
the primary ccache in the collection.
Limit iteration for DIR:: ccaches

When we're iterating through DIR:: ccache collections, limit ourselves
to the named subsidiary, as the docs indicate should happen.