Optimize task switch routine for the case when task switch is not needed
Add support for a separate interrupt stack