threadstest: fixed deadlock