PE-362: improve SSH connection timeout handling

This patch improves the handling of a timeout during SSH connection establishment.