demux_mkv: static allocation for lace sizes buffer

Avoid messy memory management and error handling.

remove tmp_lace_buffer non-sense

Not sure how my mind got 8k, or how this made sense at all.
demux_mkv: use a bounded buffer for block data

Should help avoiding out-of-bounds reads.
demux_mkv: check block malloc() result
demux_mkv: there can be 256 laces

The lace number is stored with an offset of 1, so the maximum number
of laces is 255+1=256.
demux_mkv: get rid of the duplicated lace case labels

Also change the extracting of the lace type bitfield from flags to
make it more apparent that the value range is 0-3.
demux_mkv: verify laces separately, and in all cases
demux_mkv: simplify handle_block() logic a bit
mplayer: take tracks from first segment if main file is empty

With Matroska ordered chapters, the main file (i.e. the file you're
playing) can be empty, while all video/audio data is in linked files.
Some files don't even contain the track list, only chapter information.
mpv refused to play these, because normally, the main file dictates the
track layout.

Fix this by using the first segment for track data if no part of the
timeline is sourced from the main file.
demux_mkv: don't terminate if there are no clusters

Matroska segment linking allows abusing Matroska files as playlists
without any actual video/audio/sub data, making files without any
clusters still useful for the frontend.
core: matroska: support concatenated segments

Matroska files can contain multiple segments, which are literally
further Matroska files appended to the main file. They can be referenced
by segment linking.

While this is an extraordinarily useless and dumb feature, we support it
for the hell of it.

This is implemented by adding a further demuxer parameter for skipping
segments. When scanning for linked segments, each file is opened
multiple times, until there are no further segments found. Each segment
will have a separate demuxer instance (with a separate file handle
etc.).

It appears the Matroska spec. has an even worse feature for segments:
live streaming can completely reconfigure the stream by starting a new
segment. We won't add support for it, because there are 0 people on this
earth who think Matroska life streaming is a good idea. (As opposed to
serving Matroska/WebM files via HTTP.)
demux_mkv: support vp9

Note that ffmpeg doesn't provide a decoder by default yet.
matroska: update dead link
demux_mkv: remove pointless video track selection

Possibly once needed, now it's just redundant code.
demux: simpler way to notify demuxers about track switches

This interfaces assumes track switching is always successful.
demux_mkv: use new way of track switching

Since demux_mkv queries the demuxer state when reading packets, track
switching is completely passive. Cycling etc. is done by the frontend.
As result, all track switching code can be removed.
demux_mkv: code cleanup

Cleanup based on results from cppcheck-1.59
Reduce the scope of several variables
Replace 2 calloc/realloc calls with a single malloc