Thread safe Xerces-C setup / termination.

See http://xerces.apache.org/xerces-c/faq-parse-3.html#faq-6 for the limitations
on Xerces-C.
Merge pull request #924 from ktf/thread-safe-xerces-c

Thread safety -- Thread safe Xerces-C setup / termination.