Hist: fix `--exclude-pry` switch

Fix issue #874 (hist -e breaks with TypeError: can't convert
Pry::Code::LOC to String)

And add a test for that switch.