Add explicit conversion Pathname -> String

This is related to https://github.com/caskroom/homebrew-cask/pull/8022 and some of our rspec tests (after adding fakefs bootstrap) will fail while calling this code because it relies on automatic conversion from object to String (via `to_str`).

I first thought I'm gonna send a PR to fakefs to implement the `to_str` method, but after doing a quick search I rather decided to do explicit conversion here and here's why:
https://www.ruby-forum.com/topic/4405700