don't downcase a Pathname object

Fixes #3572.
Merge pull request #3587 from rolandwalker/pathname_to_s

don't downcase a Pathname object