Fixed memory leak in Unix JoystickImpl, refactored joystick code for all platforms, prevent accelerometers registering as joysticks on Unix.
Amended based on comments from last commit.
Merge branch 'bugfix/joystick'