Ensure consistency between internal and ivar path in Pathname
add test for Pathname#dup

* See #1209