Rework stopping of procs.
Before, proc_stop() would sleep until all running lwps stopped. This
break when a stop signal is actually coming from the console and is
executed in the context of the idle thread.
Now we count all sleeping threads as stopped and also set LWP_WSTOP to
indicate so. These threads will stop before return to userland.
Running threads (including the current one) will eventually stop when
returning to userland and will increase p_nstopped. The last thread
stopping will then send a signal to the parent process.
Discussed-with: Thomas E. Spanjaard <tgen@netphreax.net>