fix directory listing with broken symlinks

directory listing would 404 if any listed file doesn't exist
(e.g. symlink to missing target).

Previously-failing test included.
Merge pull request #6358 from minrk/contents-missing

fix directory listing with broken symlinks