Fix a regression from prior to 11.2 that caused MSI (not MSI-X) interrupt
allocation to fail. While here, refactor the code so that it's more clear
and less likely to break in the future. This is not an MFC due to the code
in 12/head being very different, but it follows the latter's structure
more closely than before.
Reported by: Harry Schmalzbauer