add sync method task::wait_for, remove message dispatch window, etc.

add sync method task::wait_for,
make a task whole life cycle in one thread
remove message dispatch window

there is a potential dead lock when a task (called A) calls some Win32
synchronous API which can make this thread alterable again.  Under this
circumstance, if another task (called B) will be scheduled to run by the
thread and B requires resource to continue while this resource is hold
by A, then deadlock happens.