avformat/hlsenc: fix cleanup after avformat_write_header()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>