Fixes potential memory leak in Mac OS joystick implementation.