Avoid null pointer dereference when sending JDWP packets

Bug: 16218394

(cherry picked from commit 60ed7da4d193e0f90b05c4236af77d3b276c0ea4)

Change-Id: I4882b3b6bb97facb8fca4c7ece65f4c7c96c57fe
diff --git a/runtime/jdwp/jdwp_main.cc b/runtime/jdwp/jdwp_main.cc
index 4155c82..a4f427c 100644
--- a/runtime/jdwp/jdwp_main.cc
+++ b/runtime/jdwp/jdwp_main.cc
@@ -143,7 +143,7 @@
 }
 
 void JdwpState::SendBufferedRequest(uint32_t type, const std::vector<iovec>& iov) {
-  if (netState->clientSock < 0) {
+  if (!IsConnected()) {
     // Can happen with some DDMS events.
     VLOG(jdwp) << "Not sending JDWP packet: no debugger attached!";
     return;
@@ -167,7 +167,7 @@
 }
 
 void JdwpState::SendRequest(ExpandBuf* pReq) {
-  if (netState->clientSock < 0) {
+  if (!IsConnected()) {
     // Can happen with some DDMS events.
     VLOG(jdwp) << "Not sending JDWP packet: no debugger attached!";
     return;