Json: Correct UTF-16 surrogate calculation.

Plus avoid a warning.