Reverting from incorrect usage of pthread_exit