Revert "remove duplicate calls to Thread.current.set_trace_func()."

This reverts commit 1c800e702e11e9c5cbf0a39ad54189f3ff927503.