lavf: prevent infinite loops while flushing in avformat_find_stream_info