Test sshd connectivity to VM before trying to ssh

Replace the actual sleep delay with a real connectivity test