Minor improvement to handling of JsonGenerator.close() on exception case