Improved multithreadedness

Added several places where interrupts are temporarily allowed when
computing heading.