Fixes #2571. Escape the . in the regex that removes ".md" from help filenames

This was causing an issue with the file "gemdir.md"; it caused "gir.md"
to appear in the list of commands that have help available instead of
"gemdir".
Anchor .md filename replacement to the end of the filename

Improves the fix for #2571. Makes sure that we only remove ".md" in a
help filename if it's at the end.
Merge pull request #2574 from carols10cents/escape_help_regex

Improve regex that replaces ".md" in help filenames