Fix crash on exit of mame executable when initiated from the joystick.