Merge issue #13120: Allow to call pdb.set_trace() from thread.

Patch by Ilya Sandler.