Use Hash#each_key instead of Hash#keys.each

`Hash#keys.each` allocates an array of keys; `Hash#each_key` iterates through the keys without allocating a new array. This is the reason why `Hash#each_key` exists.

This is a more comprehensive pull request that closes #17083.

###### Benchmark

```ruby
require 'benchmark/ips'

HASH = Hash[*('aa'..'zz')]

def slow
  HASH.keys.each { |k| k }
end

def fast
  HASH.each_key { |k| k }
end

Benchmark.ips do |x|
  x.report('slow') { fast }
  x.report('fast') { slow }
end
```

###### Ruby 2.1.2p95

```
slow 34702.1 (±9.8%) i/s - 172725 in 5.074038s
fast 46103.3 (±8.1%) i/s - 232512 in 5.076248s
```
Looks good this way