Ensure that DDM processing doesn't leave unhandled exceptions

Previously if a DDM chunk handler returns an invalid chunk the thread
that processed the chunk could end up with an unhandled exception.
This could be troublesome if it happened on a debugger thread, which
might never actually handle it.

Test: ./test.py --host -j50
Bug: 70570850
Change-Id: Ic67db951d721cf7532b08c0cc3f35bed9396d52d
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index b8f15af..a6efdf5 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -4382,6 +4382,14 @@
                           length,
                           reinterpret_cast<jbyte*>(out_data->data()));
 
+  if (env->ExceptionCheck()) {
+    LOG(INFO) << StringPrintf("Exception thrown when reading response data from dispatcher 0x%08x",
+                              type);
+    env->ExceptionDescribe();
+    env->ExceptionClear();
+    return false;
+  }
+
   return true;
 }