TOOLS/idet.sh: Adjust for changes in FFmpeg.

Compatibility to older idet is preserved.
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.
README: cleanup contact section

I spotted to the grammatically incorrect "it's", and ended up redoing
parts of the section.
subprocess: minor cosmetic cleanup

Don't recursively include the whole stream.h header; only include what's
minimally needed, and handle the rest with forward declarations.
input: set mouse area by default for all input

Otherwise, mouse button bindings added by mp.add_key_binding() would be
ignored.

It's possible that this "breaks" some older scripts using undocumented
Lua script functions, but it should be safe otherwise.

Fixes #1283.
x11: fix crash with --wid=0 and vo_xv/vo_x11

But seriously, don't use --wid=0, don't use vo_xv, and _especially_
don't use vo_x11.

Fixes #1284.
x11: fix crash

Broken by previous commit. Oops.
client API: restrict client names

Use a fixed size array for the client name, which also limits the client
name in size. Sanitize the client name string, and replace characters
that are not in [A-Za-z0-9] with '_'.
input, lua: redo input handling

Much of it is the same, but now there's the possibility to distinguish
key down/up events in the Lua API.
player: don't crash when using sub_seek without subtitles

Recent regression. It turns out the assertion was completely unneeded.

Fixes #1285.
command: don't queue framesteps

If repeated framestep commands are sent, just unpause the player, instead
of playing N frames for N repeated commands.
lua, ipc: remove leftovers

MPV_EVENT_SCRIPT_INPUT_DISPATCH is now unused/deprecated.

Also remove a debug-print from defaults.lua.
lua: always handle key repeat on the script side

Simpler, and leaves the decision to repeat or not fully to the script
(instead of requiring the user to care about it when remapping a script
binding).
lua: remove redundant call
input: simplify