Allow downloading dotfiles

Our directory-traversal code overzealously rejected requests for
/Ticket/Attachment/100/200/.bashrc and the like, making the "download"
links for uploaded dotfiles appear to return a blank page.

Allow /.something, but reject /./, /../, ../, /., /.., and the like.

Fixes issues #29700.
Merge branch '4.0/dotfile-downloads' into 4.0-trunk