fixes some problem when freeing unititialized mutexes Daniel

* globals.c threads.c: fixes some problem when freeing unititialized
  mutexes
Daniel
diff --git a/threads.c b/threads.c
index 777339c..3a879fc 100644
--- a/threads.c
+++ b/threads.c
@@ -134,6 +134,8 @@
 void
 xmlFreeMutex(xmlMutexPtr tok)
 {
+    if (tok == NULL) return;
+
 #ifdef HAVE_PTHREAD_H
     pthread_mutex_destroy(&tok->lock);
 #elif defined HAVE_WIN32_THREADS