iOS: Fixed possible crash on disconnect