win32: fixed access violation error in the moment of disconnect