Fixed a sigsegv, alocating event queue before creating the thread