Fix conditional compilation.
Don't wake up from sleep unless task is being switched. This avoid
spending unnecessary cycles in idle task when there is nothing to do
really (idea copied from msp430 port).