pci: Clean up error checking in pci_add_capability()