Add THREAD_FLAGS_EXIT_ON_IRQ for preempted threads

Adds a THREAD_FLAGS_EXIT_ON_IRQ flag to the saved state of a thread
to make it possible to check that no other thread may resume if there's
a thread preempted by an IRQ.
Fix warning in sta_helloworld

* Fixes a couple of printf warnings visible on higher log levels.
* Cleans up core/arch/arm32/sta/sub.mk
* Adds a compiler.h to provide the __unused macro to avoid warnings
  about unused parameters.