lua: subprocess: use overlapped I/O on Windows

Instead of threads, use overlapped (asynchronous) I/O to read from both
stdout and stderr. Like in d0643fa, stdout and stderr could be closed at
different times, so a sparse_wait function is added to wrap
WaitForMultipleObjects and skip NULL handles.
stream: signal a Windows event object on cancel

This will be used in the following commit to cancel subprocesses started
by Lua.
lua: subprocess: support cancellation on Windows
stream: reduce ifdeffery for win32 somewhat

Remove the ones which are not strictly needed.