small fix to avoid potential problem due to ordering of freeing data

* xpath.c: small fix to avoid potential problem due to
  ordering of freeing data
* python/Makefile.am: people were complaining about
  the generated file in python dir not being built
Daniel
diff --git a/xpath.c b/xpath.c
index 1f57544..032c9b1 100644
--- a/xpath.c
+++ b/xpath.c
@@ -3071,8 +3071,8 @@
     if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
 	if (obj->boolval) {
 	    if (obj->user != NULL) {
-		xmlFreeNodeList((xmlNodePtr) obj->user);
                 xmlXPathFreeNodeSet(obj->nodesetval);
+		xmlFreeNodeList((xmlNodePtr) obj->user);
 	    } else if (obj->nodesetval != NULL)
 		xmlXPathFreeValueTree(obj->nodesetval);
 	} else {