core::rt: Insert calls to run_cleanup_tasks after all context switches