That error is usually because of an unstable overclock or less frequently, a bad sd card. PiMAME is built on top of Raspbian, so it should work just fine.
You might also want to check your power supply, and make sure that you shutdown properly rather than just remove power. You can shut down from the PiMAME menu by going to Tools->Shut Down, or from the command line: sudo poweroff.
My blog of various geeky things - http://blog.sheasilverman.com
PiPLAY - http://piplay.org
DeskCade.com - Mini Raspberry Pi Arcade Cabinet