bpo-44348: Move trace-info to thread-state (GH-26623)

* Move trace-info to thread state.

* Correct output for pdb when turning on tracing in middle of line
4 files changed