Fix case where paramiko doesn't find any ssh keys

At least some versions of paramiko's ssh agent objects are born without a keys attribute if they don't have any keys, as opposed to agent.keys as empty list. Check for that case with hasattr before checking whether the keys attribute is falsy