enhanced by adding mutex to protect global structures in a multi-threading

* xmlmemory.c: enhanced by adding mutex to protect global
  structures in a multi-threading environment.  This fixed
  some random errors on the Threads regression tests.

* encoding.c, include/libxml/encoding.h: Enhanced the handling of
  UTF-16, UTF-16LE and UTF-16BE encodings.  Now UTF-16 output is
  handled internally by default, with proper BOM and UTF-16LE
  encoding.  Native UTF-16LE and UTF-16BE encoding will not generate
  BOM on output, and will be automatically recognized on input.
* test/utf16lebom.xml, test/utf16bebom.xml, result/utf16?ebom*:
  added regression tests for above.
2 files changed