some minor fixes, and always printf in write syscall

some not so minor issues with thread.c that made it not work at all
now it actually gets the right parent id and does all the thread checking properly
so that process_wait won't just quit right away

the next problem is that we never get any output from our user programs
they are always making syscall #9 (SYS_WRITE), but this is not implemented,
so we'd like to just make it always a printf right now, regardless of fd
(basically assume the file descriptor is 1)

this should help it pass a lot of tests ...