demux_mkv: remove unused field
threads: add wrapper for initializing recursive mutexes

Damn this overly verbose pthread API.
threads: add function to calculate deadline for timed waits

Usually, you have to call pthread_cond_timedwait() in a loop (because it
can wake up sporadically). If this function is used by another higher
level function, which uses a relative timeout, we actually have to
reduce the timeout on each iteration - or, simpler, compute the
"deadline" at the beginning of the function, and always pass the same
absolute time to the waiting function.

Might be unsafe if the system time is changed. On the other hand, this
is a fundamental race condition with these APIs.
cache: refuse to seek outside of cache boundaries

Note that this still happens in the stream level, so we can't have
nice highlevel behavior restricting seeking. Instead, if a seek leads
to the demuxer requesting data outside of the cached range, the seek
will simply fail. This might confuse the demuxer, and the resulting
behavior is not necessarily useful.

Note that this also doesn't try to skip data on a forward seek. This
would just freeze the stream with slow unseekable streams.

One nice thing is that stream.h has a separate function for merely
skipping data (separate from seeking forward), which is pretty useful
in this case: we want skipping of data to work, even if we reject
seeking forward by skipping data as too expensive. This probably is
or will be useful for demux_mkv.c.