core: sched_switch only switch for higher priority

sched_switch() is called when another thread was awakened to test if the
current thread should yield.

A thread should only yield for a thread of a higher priority.