Fixes #3490: Fixes OpenIB BTL segfault when no CPC is found on a port

Custom patch from ticket.