DVR: Fix memory leaks
DVR: Fix the wrong memory access

Note that dvr_thread() uses the de->de_s contents which is
freed in subscription_unsubscribe().

Move the subscription_unsubscribe() as last.
descrambler: do not allow to open new pids when flushed
globalheaders (matroska): reorganize refcounting for readability
tsfix (matroska, htsp): fix memory leaks (refcounting)