kernel: Allow threads to yield CPU properly