Switch to highest-priority task when task is exiting.
The software interrupt is pended directly via the interrupt controller, so no need to clear Cause.IP0.
Bugfix: if tn_sys_tslice_ticks could exit without restoring interrupt status. Reported by @dimonomid.