old-build: adjust to latest changes
win32: make lseek() fail on pipes

On MingGW seeking on pipes succeeds.

This fix is quite similar to Gnulib's (lib/lseek.c).
win32: get rid of mp_stat in the normal source code

mp_stat() instead of stat() was used in the normal code (i.e. even
on Unix), because MinGW-w64 has an unbelievable macro-mess in place,
which prevents solving this elegantly.

Add some dirty workarounds to hide mp_stat() from the normal code
properly. This now requires replacing all functions that use the
struct stat type. This includes fstat, lstat, fstatat, and possibly
others. (mpv currently uses stat and fstat only.)
win32: clear window handle on destruction

As I understand, otherwise, the code will try to destroy the same
window again in the cleanup part of the gui_thread(), which makes no
sense and is potentially dangerous.
ipc: fix a small memory leak