[arch][arm-m] slight code optimization in the context switch path
[kernel][thread] quick optimization to precheck the scheduler before trying

Before putting the old thread into the run queue, do a quick check to
see if there's any potential for reschedule in the yield and preempt case.