Fix multiple joystick handling under windows, and fix desynched CJoystick API