Fix JSON deserializer for restarting parsing

This PR fixes the JSON deserializer so it is able to continue parsing.
You could also decrement nbuf and check whether it's `0`. This way you even wouldn't have to subtract `consumed` from `nbuf` later.