fix regression in pthread_exit