fix(connection): check for a destroyed socket