merge revision(s) r46419,r46429: [Backport #9940]

	* vm_trace.c: clear and restore recursive checking thread local data
	  to avoid unexpected throw from TracePoint.
	  [Bug #9940]

	* test/ruby/test_settracefunc.rb: add a test.

	* thread.c: adde
	  * rb_threadptr_reset_recursive_data(rb_thread_t *th);
	  * rb_threadptr_restore_recursive_data(rb_thread_t *th, VALUE old);

	* vm_core.h: ditto.

	* thread.c: added


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