[Tts/Stt] Use thread lock only when add and remove event handler (#2782)