Fixed threading issues in TemplateXsltExtensions

Improved thread-safety by replacing instances of Dictionary with ConcurrentDictionary.