pthread: Fix deadlock during thread initialization