hash.c: do not explode on Hash#hash

This fixes exploding of recursive hashes, as inserting the hash into
itself would trigger an explode and lead to a corrupted hash and
wasted memory.
Merge branch 'pull-495-fixes' of git://80x24.org/ruby into cachelined