stat: fixed null-byte json string generation