check if ssh is busy before closing the connection