Join the permanent and switched lives on the headunit and join them to the permanent live from the car wiring. If it comes on by switching the headunit itself on then that should rule out the permanent live in the car.
My guess, as i had the same thing, is the ignition switch. They're fairly common to wear on the Mk3! Easy to change and its a £9 part on ebay.
Edit: just seen that's pretty much what was already said after reading 3 times!lol Mine also cut out randomly on bends, bumps etc but the engine kept running...not had a problem since changing the switch.