symbol.c (rb_sym2id): do not return garbage object

The dynamic sym passed to rb_sym2id may be a garbage object
(as accounted for by dsymbol_check).  This fixes an occasional
segfault in "make test-all" for me.

No need to backport, this is from the new symbol GC feature.

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