[OPTIM] reduce the number of calls to task_wakeup()

A test has shown that more than 16% of the calls to task_wakeup()
could be avoided because the task is already woken up. So make it
inline and move the test to the inline part.
2 files changed