Use correct length to convert json unicode escapes.

Bug reported on IRC - fix due to Andrew Gierth.