Trapping wait_thread itself and returning the proper
exit_value depending on whether wait_thread is nil.