demux/subtitle: TextLoad + TextUnload: prevent double-free
There is a relationshop between the value of txt->i_line_count and
txt->line stating that the value of txt->line is undefined if
txt->i_line_count is zero.
As the above might seem simple enough, it leads to a case double-free
if one does not pay attention and check the value of txt->i_line_count
prior to working with txt->line; as in TextUnload.
These changes make sure that we do not read from txt->line unless we
know that it is safe.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>