stop final comma in JSON file writer