Make Schema Fetching thread safe.

This uses a mutex to allow for safe updating of the schema
by one and only one bot thread or process. Other bot threads
have to wait until its updated before reading.
Use Event Wait handle instead of mutex.

This construct is more appropriate because it acts like a gate.
The threads waiting to read can all read in parallel once the writer is done.
Merge pull request #278 from cwhelchel/fix/issue262

Make Schema Fetching thread safe.  Fixes #262.