Do not read pqi capability register twice
device consumer index register is 16 bits, not 32

No need to read it into a 32 bit value.
Use safe variants of read/write where necessary.

This is for PCI hot plug reasons.  We might get back -1
when reading any device registers if the device is removed.