Make HIDAPI_JoystickOpen() more robust against internal logic errors Fixes https://github.com/libsdl-org/SDL/issues/6030