This was the biggie.  When only passing a single argument, the `write()` method defaults to using `sizeof(json)` as the second argument.  Obviously the size of a string pointer is much shorter than the string.  Why this worked at all, I don't know.  But now the size is explicitly set.