applied patch from Richard Jinks for the namespace axis + fixed a memory

* xpath.c: applied patch from Richard Jinks for the namespace
  axis + fixed a memory error.
* parser.c parserInternals.c: applied patches from Peter Jacobi
  removing ctxt->token for good.
* xmlschemas.c xmlschemastypes.c: fixed a few memory leaks
  popped out by the regression tests.
* Makefile.am: patch for threads makefile from Gary Pennington
Daniel
diff --git a/xmlschemas.c b/xmlschemas.c
index bae2c7a..99956d4 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -210,6 +210,20 @@
 }
 
 /**
+ * xmlSchemaFreeAnnot:
+ * @annot:  a schema type structure
+ *
+ * Deallocate a annotation structure
+ */
+static void
+xmlSchemaFreeAnnot(xmlSchemaAnnotPtr annot)
+{
+    if (annot == NULL)
+        return;
+    xmlFree(annot);
+}
+
+/**
  * xmlSchemaFreeNotation:
  * @schema:  a schema notation structure
  *
@@ -310,6 +324,8 @@
 	xmlSchemaFreeValue(facet->val);
     if (facet->regexp != NULL)
 	xmlRegFreeRegexp(facet->regexp);
+    if (facet->annot != NULL)
+	xmlSchemaFreeAnnot(facet->annot);
     xmlFree(facet);
 }
 
@@ -346,20 +362,6 @@
 }
 
 /**
- * xmlSchemaFreeAnnot:
- * @annot:  a schema type structure
- *
- * Deallocate a annotation structure
- */
-static void
-xmlSchemaFreeAnnot(xmlSchemaAnnotPtr annot)
-{
-    if (annot == NULL)
-        return;
-    xmlFree(annot);
-}
-
-/**
  * xmlSchemaFree:
  * @schema:  a schema structure
  *