Remove 'nil' from array before returning

Fixes https://github.com/fastlane/fastlane/issues/21768 when there is no device match for a given name.