libpkgconf: fragment: split out per-fragment length calculation and use it for all render functions (buffer overrun hardening)