client: prevent calling failure function twice while checking
connection