Don't forget to flush XLOG_PARAMETER_CHANGE record.

Backpatch to 9.0 where XLOG_PARAMETER_CHANGE record was instroduced.
Tidy up the populate/to_record{set} code for json a bit.

In the process fix a small bug.