Move the API guard out of the worker threads onto the manager thread.

Just set this once before spawning multiple worker threads.

Change-Id: I9cb60721f633f939d4a95f1d80e2ed8e4542a8fa
Guard access to external ref manager instance.

Change-Id: Ie3208844b523463954c482d080f02d726ae749f9
Make this thread safe too.

Change-Id: Ic8508f693f8a6e9bae513d6b5b6eaaaae618194b
Guard CharacterClassificationImpl with mutex.

They are accessed from multiple threads frequently.

Change-Id: I3f9720ede076109efe0b7eaa4a05dd50f2e38102
Thread-safe way to check for presence of references in formula tokens.

Change-Id: I995668d1e183dc0dae4f354889bc13053e858723
Mutex access to the global theIndexTable.

Change-Id: I31e2cf3a479e385aa0fca4678a3a2c7fa6cc4b5f