sched: core: fixed a rq removal bug

rq_remove_thread would run into trouble if it had to remove the
currently running thread. To do so, you need to remove the runnable mask
and set a resched mask and then request a context switch using
`schedule()'.

In the process, another bug involving the adding of threads to wake/kill
queue's got fixed. These threads shouldn't use rq_remove_thread untill
they are completely finished, because if its about the currently running
thread the context will be switched before anything useful is done.

Signed-off-by: Michel Megens <dev@michelmegens.net>