Fix uninitialized variable that causes bad syntax

`need_comma` is uninitialized but the code assumes it begins with a value of `0`.  This will work sometimes, but occasionally results in output with bad syntax (caused by an extra comma).