free NULL cleanup

Start ensuring all OpenSSL "free" routines allow NULL, and remove
any if check before calling them.
This gets DH_free, DSA_free, RSA_free

Reviewed-by: Matt Caswell <matt@openssl.org>
diff --git a/apps/gendsa.c b/apps/gendsa.c
index fd1360a..d330a01 100644
--- a/apps/gendsa.c
+++ b/apps/gendsa.c
@@ -271,8 +271,7 @@
         BIO_free(in);
     if (out != NULL)
         BIO_free_all(out);
-    if (dsa != NULL)
-        DSA_free(dsa);
+    DSA_free(dsa);
     if (passout)
         OPENSSL_free(passout);
     apps_shutdown();