pci: Move PCI header output code into its own function