Fix MAME shutdown