Fixing two mistakes: Thread status is correctly updated when going through thread_exit and yield is now avoiding swap if the thread calling yield is the only active thread