ProviderBase does not close JsonGenerator

If flush-after-write is disabled, this causes written content to be lost in a buffer.