aviocat: Flush the output before closing