Robustify Thread::DumpState.

Check Thread::Current isn't NULL before using in ScopedObjectAccess that will
attempt to dereference it.

Change-Id: Ia3fc84dbf649edfa7fda5202abf9e397a794e0cd
diff --git a/src/thread.cc b/src/thread.cc
index c878a86..7021771 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -671,7 +671,7 @@
   bool is_daemon = false;
   Thread* self = Thread::Current();
 
-  if (thread != NULL && thread->opeer_ != NULL) {
+  if (self != NULL && thread != NULL && thread->opeer_ != NULL) {
     ScopedObjectAccessUnchecked soa(self);
     priority = soa.DecodeField(WellKnownClasses::java_lang_Thread_priority)->GetInt(thread->opeer_);
     is_daemon = soa.DecodeField(WellKnownClasses::java_lang_Thread_daemon)->GetBoolean(thread->opeer_);