Fixed JSONWriter closing.