demux_lavf: sanity-check stream ID before using it.