Update thread.c

There were some errors, I guess I stupidly deleted a line (struct thread* t;), and also made the function thread_sleep() static. Now it runs correctly as it was on our last meeting.