Context switch tweaks:
- Test if context switch is actually needed before pending interrupt in tn_switch_context
- Remove unnecessary TCB pointer check from task switch interrupt handler
- Disable interrupts only after storing current task's stack pointer into TCB
- Re-enable interrupts when restoring task state
- Some other small tweaks