json: fix off-by-one in memory alloc

Tighten it a bit too, checking for empty string.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 file changed