Fix the pthread_setname_np test.

Fix the pthread_setname_np test to take into account that emulator kernels are
so old that they don't support setting the name of other threads.

The CLONE_DETACHED thread is obsolete since 2.5 kernels.

Rename kernel_id to tid.

Fix the signature of __pthread_clone.

Clean up the clone and pthread_setname_np implementations slightly.

Change-Id: I16c2ff8845b67530544bbda9aa6618058603066d
diff --git a/libthread_db/libthread_db.c b/libthread_db/libthread_db.c
index e749377..bd78ae6 100644
--- a/libthread_db/libthread_db.c
+++ b/libthread_db/libthread_db.c
@@ -161,7 +161,7 @@
 td_thr_get_info(td_thrhandle_t const * handle, td_thrinfo_t * info)
 {
     info->ti_tid = handle->tid;
-    info->ti_lid = handle->tid; // Our pthreads uses kernel ids for tids
+    info->ti_lid = handle->tid;
     info->ti_state = TD_THR_SLEEP; /* XXX this needs to be read from /proc/<pid>/task/<tid>.
                                       This is only used to see if the thread is a zombie or not */
     return TD_OK;