Small internal changes in curve checking

- switch from is_acceptable to the more usual check
- add NULL check just in case user screwed up config
diff --git a/library/ssl_cli.c b/library/ssl_cli.c
index 3d3f3d1..e4f0686 100644
--- a/library/ssl_cli.c
+++ b/library/ssl_cli.c
@@ -1684,7 +1684,7 @@
     MBEDTLS_SSL_DEBUG_MSG( 2, ( "ECDH curve: %s", curve_info->name ) );
 
 #if defined(MBEDTLS_ECP_C)
-    if( ! mbedtls_ssl_curve_is_acceptable( ssl, ssl->handshake->ecdh_ctx.grp.id ) )
+    if( mbedtls_ssl_check_curve( ssl, ssl->handshake->ecdh_ctx.grp.id ) != 0 )
 #else
     if( ssl->handshake->ecdh_ctx.grp.nbits < 163 ||
         ssl->handshake->ecdh_ctx.grp.nbits > 521 )