[3.14] gh-125434: Display thread name in faulthandler on Windows (#142011)
* gh-125434: Display thread name in faulthandler on Windows (#140675)
(cherry picked from commit
313145eab5f6ebca21d2e3c80c130980d3bcdc88)
* gh-125434: Fix non-ASCII thread names in faulthandler on Windows (#140700)
Add _Py_DumpWideString() function to dump a wide string as ASCII. It
supports surrogate pairs.
Replace _Py_EncodeLocaleRaw() with _Py_DumpWideString()
in write_thread_name().
(cherry picked from commit
80f20f58b2b8368ed8451a0161036dda94d8d33a)