Move some Windows operations to worker thread
On Windows, certain debugging APIs can only be called from the thread
that started (or attached) to the inferior. Also, there is no way on
Windows to wait for a debug event in addition to other events.
Therefore, in order to implement target async for Windows, gdb will
have to call some functions in a worker thread.
This patch implements the worker thread and moves the necessary
operations there. Target async isn't yet implemented, so this patch
does not cause any visible changes.