log refusal to serve hidden files dirs
fix test suite

is_hidden expects the file to actually exist, so I've rearranged the
logic such that is_hidden is called only after it's clear that the file
exists.
Merge pull request #5158 from ivanov/fix-5157

log refusal to serve hidden directories