cortex-m: disallow rescheduling if task_start() has not yet run
cortex-m: disallow rescheduling if task_start() has not yet run

Most GPIO/peripheral interrupts are enabled in HOOK_INIT or some other
*_init() functions that are called before task_start(). Quite a lot of
these IRQ handler wake some task to process the interrupt, and this
causes a race condition. If the interrupt is triggered before
task_start() is called, the system may crash/hang/whatever.

Fix this by only allowing rescheduling tasks if task_start() is called.
This is basically the cortex-m version of commit e541eeb2.

BRANCH=Ryu
BUG=None
TEST=Without this fix, my Ryu P3 always crashes when cold resetting from
bootloader mode. After applying this fix, it doesn't anymore.

Change-Id: I0f81e90482ff97469c4f0423d6aa060f2ac76f74
Signed-off-by: Vic Yang <5fd92abeee651458f98e2856f4f200ee971cee4d@google.com>
Reviewed-on: https://chromium-review.googlesource.com/243626
Tested-by: Vic Yang <5fd92abeee651458f98e2856f4f200ee971cee4d@chromium.org>
Reviewed-by: Alec Berg <1a4429eeda29095a12e19a73405f80f5b7f37a63@chromium.org>
Commit-Queue: Vic Yang <5fd92abeee651458f98e2856f4f200ee971cee4d@chromium.org>

coreboot/chrome-ec,akappy7/ChromeOS_EC_LED_Diagnostics,eatbyte/chromium-ec,coreboot/chrome-ec,fourier49/BIZ_EC,md5555/ec,md5555/ec,coreboot/chrome-ec,fourier49/BZ_DEV_EC,fourier49/BZ_DEV_EC,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,eatbyte/chromium-ec,fourier49/BIZ_EC,akappy7/ChromeOS_EC_LED_Diagnostics,md5555/ec,fourier49/BIZ_EC,akappy7/ChromeOS_EC_LED_Diagnostics,akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BZ_DEV_EC,eatbyte/chromium-ec,fourier49/BIZ_EC,fourier49/BZ_DEV_EC,md5555/ec,eatbyte/chromium-ec,coreboot/chrome-ec,coreboot/chrome-ec