serialize: Avoid stray nul characters when auto-serializing char.

Fixes #19719.
Merge pull request #19764 from lifthrasiir/that-stray-nul

serialize: Avoid stray nul characters when auto-serializing char.

Reviewed-by: alexcrichton