Fix NPE which is causing com.android.phone to crash.

It is possible for getOriginalConnection() to return null at the end of
a call once the RIL has disconnected it.  Added null check to ensure
that isImsConnection() won't throw an NPE in this case.

The original code was the following, which is inherently NPE safe:
return getOriginalConnection() instanceof ImsPhoneConnection;

Bug: 26222625
Change-Id: Iaa77a4d739578ddcfbbb5849f7ddf15e3bad0f76
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index d9d203d..b6e58d5 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -1103,7 +1103,9 @@
      *     otherwise.
      */
     protected boolean isImsConnection() {
-        return getOriginalConnection().getPhoneType() == PhoneConstants.PHONE_TYPE_IMS;
+        com.android.internal.telephony.Connection originalConnection = getOriginalConnection();
+        return originalConnection != null &&
+                originalConnection.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS;
     }
 
     /**