x509: fix remaining unchecked call to mbedtls_md()

The other two calls have been fixed already, fix that one too for consistency.
diff --git a/library/x509_crt.c b/library/x509_crt.c
index c797e74..e2ad579 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -2098,17 +2098,13 @@
         *flags |= MBEDTLS_X509_BADCERT_BAD_PK;
 
     md_info = mbedtls_md_info_from_type( child->sig_md );
-    if( md_info == NULL )
+    if( mbedtls_md( md_info, child->tbs.p, child->tbs.len, hash ) != 0 )
     {
-        /*
-         * Cannot check 'unknown' hash
-         */
+        /* Note: this can't happen except after an internal error */
         *flags |= MBEDTLS_X509_BADCERT_NOT_TRUSTED;
     }
     else
     {
-        mbedtls_md( md_info, child->tbs.p, child->tbs.len, hash );
-
         if( x509_profile_check_key( profile, child->sig_pk, &parent->pk ) != 0 )
             *flags |= MBEDTLS_X509_BADCERT_BAD_KEY;