DE1541. Fix access of uninitialized variable in measures2csv.

Also restore memory leak and buffer overflow fixes.
Merge pull request #344 from asfadmin/leakfixes

DE1541. Fix access of uninitialized variable in measures2csv.