Separated joystick state from window system state.

This is partially in preparation for pending support for additional
joystick APIs like XInput, DirectInput and IOHID.