Cannot rely on %z printf length modifier.

Before version 9.4, we didn't require sprintf to support the %z length
modifier. Use %lu instead.

Reported by Peter Eisentraut. Apply to 9.3 and earlier.