[ca] make tokenizer thread-safe