I thought I would help by giving my experience with this issue. In attract mode, you can set a hotkey to exit the emulator, which hard closes the emulator every time. The problem is, if you do this with mame, the settings you made to controls will not save. This also includes games with saved profiles (I was having a lot of trouble figuring out why my profile in NBA Hangtime would not be saved from session to session). The only way to save those settings is by exiting mame the "normal" way, whatever hotkey you have specified in Mame (usually esc). It seems that mame doesn't actually save settings until you close the mame window, but if you force close it using the hotkey in attract mode, it's as if you killed the process and mame won't save those settings.
Now, the problem with that is the problem I'm having currently. If you use a hotkey to close mame the "normal" way, attract mode will not focus back into view (this is on windows). You have to hit alt-tab and attract mode will come back immediately, but if you don't, you will sit at a frozen mame screen indefinitely. This is obviously annoying and not ideal for us with no keyboard attached to our arcade computers. So, it's kind of a rock and a hard place, either close via attract mode and not have settings save, or close by mame and not have attract mode come back in focus. Before anyone mentions resfix, I do have that installed and working. Hopefully this helps with troubleshooting, since I don't currently have a solution. There's another user with a program on this forum that runs in the background and shows a black screen in between transitions that is supposed to help, but it seems unnecessary to me.