input: fix behavior if there are actually key up events

Wayland is the only backend that actually sends per-key key up events
(the X11 one just sends MP_INPUT_RELEASE_ALL for simplicity). Handling
was broken with Wayland, and each key event was interpreted twice, once
on key down and once on key up.

This commit should fix it.
input: require VOs to send key up events, redo input key lookup

Making key up events implicit was sort-of a nice idea, but it's too
tricky and unreliable and makes the key lookup code (interpret_keys())
hard to reason about. See e.g. previous commit for subtle bugs and
issues this caused.

Make key-up events explicit instead. Add key up events to all VOs.
Any time MP_KEY_STATE_DOWN is used, the matching key up event must
use MP_KEY_STATE_UP.

Rewrite the key lookup code. It should be simpler and more robust now.
(Even though the LOC increases, because the new code is less "compact".)
cache: fix per-block metadata memory leak
core: update metadata during playback, allow streams to export metadata

STREAM_CTRL_GET_METADATA will be used to poll for streamcast metadata.
Also add DEMUXER_CTRL_UPDATE_INFO, which could in theory be used by
demux_lavf.c. (Unfortunately, libavformat is too crappy to read metadata
mid-stream for mp3 or ogg, so we don't implement it.)
stream_lavf: request and read streamcast/ICY metadata

Requires recent ffmpeg git, otherwise will do nothing.
command: add some playlist manipulation commands

playlist_remove and playlist_move.
core: remove mp_fifo indirection

For some reason mp_fifo specifically handled double clicks, and other
than that was a pointless wrapper around input.c functionality.

Move the double click handling into input.c, and get rid of mp_fifo. Add
some compatibility wrappers, because so much VO code uses these
functions. Where struct mp_fifo is still used it's just a casted
struct input_ctx.
core: cleanup more mp_fifo leftovers

Now only the OSX and Wayland parts are using this.
wayland: implement MOUSE_LEAVE
wayland: remove mp_fifo
wayland: remove unused members
wayland: fix typo
cocoa: remove usage of mp_fifo

Update Cocoa parts to remove usage of the mp_fifo internal API to send events
to the core and use the input context directly. This is to follow commits the
work in commits 70a8079c and d603e73c.
wayland: remove mp_fifo header
timer: overcomplicated time experiement

Safety not guaranteed. I have only done this once before.
Merge branch 'w32-timer' of sooaweso.me:mpv