kern/dsched: Fix a panic at proc exit

 * When a proc exit, dsched tries to destroy the thread context.
   But if the thread context is not empty, it needs to wait
   for the thread ios to be drained.

 * add a callback to wakeup the thread when the last queued io is
   completed and resume the in progress destruction.

 * Should fix #2645