lua: subprocess: cancel pending I/O before return

I'm not sure if this is necessary, but it can't hurt, and it's what
you're supposed to do before leaving the stack frame that contains the
OVERLAPPED object and the buffer. If there is no pending I/O, CancelIo
will do nothing and GetOverlappedResult will silently fail.
lua: subprocess: fix Ctrl+C handling on Windows

The CREATE_NO_WINDOW flag is used to prevent the subprocess from
creating an empty console window when mpv is not running in a console.
When mpv is running in a console, it causes the subprocess to detach
itself, and prevents it from seeing Ctrl+C events, so it hangs around in
the background after mpv is killed.

Fix this by only specifying CREATE_NO_WINDOW when mpv is not attached to
a console. When it is attached to a console, subprocesses will
automatically inherit the console and correctly receive Ctrl+C events.
lua: subprocess: fix handle inheritance race condition

Normally, when creating a process with inherited handles on Windows, the
process inherits all inheritable handles from the parent, including ones
that were created on other threads. This can cause a race condition,
where unintended handles are copied into the new process, preventing
them from being closed correctly while the process is running. The only
way to prevent this on Windows XP was to serialise the creation of all
inheritable handles, which is clearly unacceptable for libmpv.

Windows Vista solves this problem by allowing programs to specify
exactly which handles are inherited, so do that on Vista and up.

See http://blogs.msdn.com/b/oldnewthing/archive/2011/12/16/10248328.aspx
lua: subprocess: use macros for SetHandleInformation

Apparently both parameters refer to the same set of flags (the first is
a mask for which flags to set.)
manpage: update utils.subprocess() for Windows
lua: subprocess: move to osdep/subprocess-{win,posix}.c

The subprocess code was already split into fairly general functions,
separate from the Lua code. It's getting pretty big though, especially
the Windows-specific parts, so move it into its own files.