[runtime] Allow getting thread name, managed id from embedding API
When tracing multi-threaded program execution, it is useful to have a
way of separating which events happen on which thread. The
System.Threading.Thread.Name and Thread.ManagedThreadId properties are
useful proxies for tracking program execution.
However, if program execution spans both managed and embedded mono
native code, there is no existing mechanism to read the Thread.Name or
Thread.ManagedThreadId properties from native code without using
delegates, and delegates may not be usable in all circumstances (e.g.
within a mono_gc_register_bridge_callbacks() callback).
Add the following APIs to the embedding API to permit reading the
Thread.Name and Thread.ManagedThreadId properties:
char *mono_thread_get_name_utf8 (MonoThread *thread);
gint32 mono_thread_get_managed_id (MonoThread *thread);
mono_thread_get_name_utf8() returns the Thread.Name value as a UTF-8
string in newly allocated memory; the caller must g_free() this value.
mono_thread_get_managed_id() returns the Thread.ManagedThreadId value.