It was suffering a race starting up the thread that could cause the main loop to quit before the main loop had started.