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
@jlee-r7 should review this PR, but noting that this attr should be documented to explain its purpose.