Added a sleep function before sending Alt-F4 to let MAME close up using the same button.