Propagate pending exception from cert_client_cb

There can be a pending exception in the cert_client_cb if the server
certificate failed verification and the server requested a client
certificate. Since the handshake is going to be terminated, just
return from client_cert_cb immediately indicating no client cert will be
provided, allowing the existing exception to propagate.

Bug: 3149826
Change-Id: If95db36fc296ec9945c052a6c839e70dcd083d7b
diff --git a/luni/src/main/native/NativeCrypto.cpp b/luni/src/main/native/NativeCrypto.cpp
index 7de8fc9..1447c3c 100644
--- a/luni/src/main/native/NativeCrypto.cpp
+++ b/luni/src/main/native/NativeCrypto.cpp
@@ -1498,6 +1498,10 @@
         JNI_TRACE("ssl=%p client_cert_cb env error => 0", ssl);
         return 0;
     }
+    if (env->ExceptionCheck()) {
+        JNI_TRACE("ssl=%p client_cert_cb already pending exception", ssl);
+        return 0;
+    }
     jobject sslHandshakeCallbacks = appData->sslHandshakeCallbacks;
 
     jclass cls = env->GetObjectClass(sslHandshakeCallbacks);