Fix the build and tests following constification of DH, DSA, RSA

Misc fixes following the constification of the DH, DSA and RSA
getters.

Reviewed-by: Stephen Henson <steve@openssl.org>
diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c
index 8146330..9c001d7 100644
--- a/crypto/dsa/dsa_lib.c
+++ b/crypto/dsa/dsa_lib.c
@@ -269,9 +269,9 @@
     /* If the fields p, q and g in d are NULL, the corresponding input
      * parameters MUST be non-NULL.
      */
-    if (d->p == NULL && p == NULL
-        || d->q == NULL && q == NULL
-        || d->g == NULL && g == NULL)
+    if ((d->p == NULL && p == NULL)
+        || (d->q == NULL && q == NULL)
+        || (d->g == NULL && g == NULL))
         return 0;
 
     if (p != NULL) {