correct calculation of last_rid
Use a sleep instead of a busy-wait
Move SR-IOV ARI enable back to pci_iov.c.  There is no guarantee that
the first function has a SR-IOV capability.