This should fix segfault that happens when pthread_setschedparam is called ona thread that already exited.