HashWithIndifferentAccess better respects #to_hash

In particular, `#update`, `#merge`, `#replace` all accept objects which
respond to `#to_hash`, even if those objects are not Hashes directly.
Merge pull request #14518 from Peeja/hash-wia-update-respects-to-hash-4-1-stable

HashWithIndifferentAccess better respects #to_hash (4-1-stable backport)