GThread: handle thread names safely