fix memory leak when creating XPath evaluators in threads