process_wait should actually wait now

process_wait was simply returning -1 immediately, regardless of the state of the thread that was started with the tid it's been passed.  The new thread would still be successfully scheduled, but since the kernel was on the way to shutting down, as soon as the new thread is preempted, the whole system halts.  This led to unpredictable behavior, with the new thread exiting whenever the kernel had a chance to preempt it (like with a printf or other system call).

Now process_wait loops until the given tid is no longer active.  It calls a new method in thread.c that searches the all_list of all alive threads for the given tid.  This is maybe not the best way, but hopefully it at least works for now ...