Fix SIGSEGV due to race condition between event logger threads