json: Fix latent parser aborts at end of input