Retain thread names as UTF8 instead of only UTF16. (mono/mono#15945)
Windows can still have its Unicode thread names, since we have UTF16 initially, just don't retain it.
This does penalize ves_icall_System_Threading_Thread_GetName_internal (non-netcore only),
which has to convert back to UTF16 each time.
But seems like a net win overall.
There is also a little prep work here for constant thread names and some temporary measures as multiple changes head toward the same code.
Rename `mono_thread_set_name_internal` to `mono_thread_set_name`.
Close possible race conditions.
Extracted from https://github.com/mono/mono/pull/15859.
Commit migrated from https://github.com/mono/mono/commit/
7b64f1cd005ef4f8e7f0aa5655debca2754b1755