HPCC-10549 Improve generated code for serializing a single row

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>