Do not rely on Hash#each_value as it blocks Hash[]= and causes
exceptions in threaded environments (#10695)