backported vs2.1.x fix to irq handling, which caused incorrect scheduler behavior