small mods, to also pass exit test

also store exit status locally in thread struct, so that if process_wait exits before we get to process_exit, we can still read the code
revert storing exit code locally

still print the required message, but since process_exit is called inside thread_exit well before the thread is killed, its just fine to reference the exit status pointer.