Use pthread_kill(3) instead of kill(2).

Another swing at useful native traces.  pthread_kill(3) uses tkill(2)
instead of kill(2), so we may have a better chance of the signal landing
on the right thread.

For bug 2517042.

Change-Id: I62871c1e21b11442ea52c861397674f1644f4da9
diff --git a/vm/Thread.c b/vm/Thread.c
index ab96abc..b46d2d8 100644
--- a/vm/Thread.c
+++ b/vm/Thread.c
@@ -3596,8 +3596,6 @@
  */
 void dvmNukeThread(Thread* thread)
 {
-    pid_t tid = thread->systemTid;
-
     /* suppress the heapworker watchdog to assist anyone using a debugger */
     gDvm.nativeDebuggerActive = true;
 
@@ -3613,11 +3611,12 @@
      * The target thread can continue to execute between the two signals.
      * (The first just causes debuggerd to attach to it.)
      */
-    LOGD("Sending two SIGSEGVs to tid=%d to cause debuggerd dump\n", tid);
-    kill(tid, SIGSEGV);
+    LOGD("Sending two SIGSEGVs to tid=%d to cause debuggerd dump\n",
+        thread->systemTid);
+    pthread_kill(thread->handle, SIGSEGV);
     usleep(2 * 1000 * 1000);    // TODO: timed-wait until debuggerd attaches
-    kill(tid, SIGSEGV);
-    LOGD("Sent, waiting to let debuggerd run\n");
+    pthread_kill(thread->handle, SIGSEGV);
+    LOGD("Sent, pausing to let debuggerd run\n");
     usleep(8 * 1000 * 1000);    // TODO: timed-wait until debuggerd finishes
     LOGD("Continuing\n");
 }