hash.c: fix segv in Hash#replace

* hash.c (rb_hash_replace): fix segv on `{}.replace({})` introduced
  in r44060 [Bug #9230] [ruby-core:58991]
* test/ruby/test_hash.rb: regression test for above

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e