Fixes NoMethodError undefined method `each' for nil:NilClass

Fixes NoMethodError undefined method `each' for nil:NilClass for ssh_login_pubkey. See https://github.com/rapid7/metasploit-framework/issues/3772