Close output files, don't leak memory