Fix various bugs in new code raised by the API checking

* testapi.c: regenerated and covering new APIs
* tree.c: xmlBufferDetach can't work on immutable buffers
* xzlib.c: fix a deallocation error
diff --git a/xzlib.c b/xzlib.c
index b2db4ee..928bd17 100644
--- a/xzlib.c
+++ b/xzlib.c
@@ -273,7 +273,7 @@
 
     opt = filter.options;
     dict_size = opt->dict_size;
-    xmlFree(opt);
+    free(opt); /* we can't use xmlFree on a string returned by zlib */
 
     /* A hack to ditch tons of false positives: We allow only dictionary
      * sizes that are 2^n or 2^n + 2^(n-1) or UINT32_MAX. LZMA_Alone