Add safety check to sample mutex implementation

Due to inconsistent freeing strategy in pkparse.c the sample mutex
implementation in threading.c could lead to undefined behaviour by
destroying the same mutex several times.

This fix prevents mutexes from being destroyed several times in the
sample threading implementation.
diff --git a/ChangeLog b/ChangeLog
index f3e60d3..a10559f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,8 @@
      a contribution from Tobias Tangemann. #541
    * Fixed cert_app sample program for debug output and for use when no root
      certificates are provided.
+   * Fixed default threading implementation to avoid accidental double
+     initialisations and double frees.
    * Fix mbedtls_x509_get_sig() to update the ASN1 type in the mbedtls_x509_buf
      data structure until after error checks are successful. Found by
      subramanyam-c.