Reinstate code accidentally removed while moving it from ThreadList to Thread.

Change-Id: I640741a4a64bccb408ac8c053a3538588fa9a8e1
diff --git a/src/thread.cc b/src/thread.cc
index 8bd7bc2..aee684b 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -985,6 +985,12 @@
   if (peer_ != NULL) {
     Thread* self = this;
 
+    // We may need to call user-supplied managed code.
+    SetState(Thread::kRunnable);
+
+    HandleUncaughtExceptions();
+    RemoveFromThreadGroup();
+
     // this.vmData = 0;
     SetVmData(peer_, NULL);