URI.escape() method has been removed in ruby 3 and
the newly added Puppet::Util.rfc2396_escape()[1]
has not been released yet.
[1] 41dcae71c7
Closes-Bug: #1928685
Change-Id: I001d579a1b126fc8254f071ddbecda5cc6de7231
This change ensures that a hash passed to a function is not directly
modified, to avoid FrozenError.
Change-Id: Ie9242d7ff5cac206ae65526e08cd096425fa4232