refs #276 Use a reader-writer lock instead of a mutex for the query
cache and nsdMap. This should prevent future scalability issues for
queries that go down this code path in the future.