If you have an aftermarket stereo hooked up it could be that the wiring was done incorrectly.
Two power wires hooked up to your after market head unit,
2. always on
If you lets say, bought a blaupunkt headunit and the factory wiring harness fit perfect in the head unit, then what happened is that you have to switch the switched/with the always on power wires.
What happens is your stereo is pulling a constant current so your ecu gets mixed codes and you'll get "reving on its own, alarm malfunctions" and other problems. I had the same exact thing happen to me when I had my MKIV Jetta 2.0. I took it into the dealer and one week later they tried to charge me with a 1,100$ bill. Which I contested with Volkswagen of America and of course got VW to pay for it. They couldn't fix it, so I went home thought about it for a couple of days, pulled the head unit on this theory rewired those two wires switching them. Then the head unit stopped pulling power from the ecu when the vehicle was off and sure enough, no more reving on its own. If you have any questions just shoot me an email.. Though I could be wrong,