merge revision(s) 44260: [Backport #9168] 

patch inspired from r44260 on trunk. [ruby-core:58652] [Bug #9168]

* gc.c (run_finalizer): clear th->errinfo before invoke finalizer and
  restore afterward.

* test/ruby/test_gc.rb (test_exception_in_finalizer): add test for
  above.

* vm_trace.c (rb_threadptr_exec_event_hooks_orig): clear th->errinfo
  before invoke hook.



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