Improve the ThreadStress test to send SIGQUIT, and fix the bug that finds.

I'd heard complaints of a system_server deadlock on crespo, but wasn't seeing
it on mysid. I did see it soon after trying to use crespo, but system_server
has way too many threads and adb is too damn unreliable for me to effectively
debug that. This improves ThreadStress so we exercise that path lots, and
catch the deadlock relatively quickly with relatively few threads.

The fix is explained in a code comment that's larger than the fix.

Change-Id: I593bc94cf1239065a604703568420986a03ce628
diff --git a/test/ThreadStress/ThreadStress.java b/test/ThreadStress/ThreadStress.java
index c294a38..1f8fb2d 100644
--- a/test/ThreadStress/ThreadStress.java
+++ b/test/ThreadStress/ThreadStress.java
@@ -20,6 +20,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import libcore.io.*;
 
 // Run on host with:
 //   javac ThreadTest.java && java ThreadStress && rm *.class
@@ -29,7 +30,8 @@
 
     enum Operation {
         OOM(1),
-        ALLOC(99),
+        SIGQUIT(19),
+        ALLOC(80),
         EXIT(50),
         WAIT(50);
 
@@ -194,6 +196,12 @@
                     case EXIT: {
                         return;
                     }
+                    case SIGQUIT: {
+                        try {
+                            Libcore.os.kill(Libcore.os.getpid(), OsConstants.SIGQUIT);
+                        } catch (ErrnoException ex) {
+                        }
+                    }
                     case WAIT: {
                         synchronized (lock) {
                             try {