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 f8890dc..e6a4dbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,8 @@
    * Fixed the sample applications gen_key.c, cert_req.c and cert_write.c for
      builds where the configuration MBEDTLS_PEM_WRITE_C is not defined. Found
      by inestlerode. #559.
+   * Fixed default threading implementation to avoid accidental double
+     initialisations and double frees.
 
 Changes
    * Extended test coverage of special cases, and added new timing test suite.