Prevent stats-to-csv from creating files that never contain data

Changed the stats-to-csv script so that it doesn't create csv files
that will never contain any data (such as "cflow.cpu.csv").  Also
simplified some of the code.