PK: Fix free(NULL) in library and tests

free() functions are documented as no-ops on NULL. Implement and test
this correctly.
diff --git a/library/pk.c b/library/pk.c
index d8bce8f..38ab774 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -90,8 +90,7 @@
  */
 void mbedtls_pk_restart_free( mbedtls_pk_restart_ctx *ctx )
 {
-    PK_VALIDATE( ctx != NULL );
-    if( ctx->pk_info == NULL ||
+    if( ctx == NULL || ctx->pk_info == NULL ||
         ctx->pk_info->rs_free_func == NULL )
     {
         return;