TS-2471: records.config becomes empty when the disk full

In lib/records/RecLocal.cc and lib/records/RecProcess.cc, records.config
may become empty when the disk is full because we write records.config
directly. We should write to a temporary file, then rename it to
records.config.
TS-2476: fix size_t format string