qemu/pci: add routines to manage PCI capabilities