bug fix: if portEXIT_CRITICAL was called from an ISR, it was enabling
interrupts during an ISR. However, some FreeRTOS functions like
xTaskRemoveFromEventList (used by SendMessageToQueueFromIsr) require
that interrupts are disabled when they are called. This occasionally
resulted in wrong thread context switches. For example, the Wrapper task
frooze occaisionally, resulting in watch dog resets.