scsi: move handling of REPORT LUNS and invalid LUNs to common code