Fixed the introduction of extra interations in kernel context_switch()