Make it possible to give threads a name.

On Haiku, this even renames the Haiku thread so that in a process
manager the thread's name can be seen. If no name has been set, it uses
the class name as name for the Haiku thread.