You can hard wire a switch to the ignition power wire (red wire). That way all you have to do is flip a switch to turn off your head unit. It should work the same as turning off the car, because the battery power wire (yellow wire) would still be connected. I would suggest you either mount the switch somewhere it can't accidentally be switched, or use a switch with a cover.
Edit: Corrected wire color.