Improve thread safety.

Also, correct a spelling error.
VIVO-668 Increase the timeout interval when waiting for the search index.