Fixes to make all run-tests except 051-thread work.

- Moved exception delivery into common method DeliverException
- Renamed old DeliverException to QuickDeliverException since it is only
  used by quick
- Fixed null checks for arrays returned by GetReference
- Standardized ArrayStoreException error message
- Added additional sleeps to ensure threads stay alive long enough in
  051-thread, and that <clinit> is complete for 084-class-init

Change-Id: I9ca306896a4bd10f453150fcf3965d9750fa0cbd
diff --git a/src/thread.h b/src/thread.h
index 4e1f0e7..112db2d 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -319,8 +319,16 @@
     DCHECK(!IsExceptionPending());
   }
 
+  void DeliverException(Throwable* exception) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+    if (exception == NULL) {
+      ThrowNewException("Ljava/lang/NullPointerException;", "throw with null exception");
+    } else {
+      SetException(exception);
+    }
+  }
+
   // Find catch block and perform long jump to appropriate exception handle
-  void DeliverException() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+  void QuickDeliverException() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   Context* GetLongJumpContext();
   void ReleaseLongJumpContext(Context* context) {