Preserve trailing new line when saving component.json, closes #285.