core::rt: Add another context switching operation to the scheduler

`switch_running_tasks_and_then` does a context switch to another
task then immediatly runs a closure.
core::rt: Simplify some scheduler operations