Correct errors in write_csv().

The number of fields in the data rows did not match the number of rows in the
header.  There were misspellings in the header.  The second field in the data
rows was superfluous.  Fields for 'subroutine' and 'total' were not being
printed out.