Fix inconsistency between flash and non-flash gamepad button states on state switches, closes #1006