Try harder to make sched_yield() schedule another runnable thread.

Resolves #695.