I just replaced the pcv valve hoping it would fix the problem, but it's still doing it. Also while coasting the car speeds up to about 17-19 mph gradually.
The reason I looked at it in the first place was due to the pcv valve being ejected from the intake manifold while I was driving it the other day. I couldn't tell if it was oil leaking or coolant leaking but there was a pretty bad leak once I got parked and opened the hood.
My car has 204000 miles.
My car has an automatic transmission.
My guess is that the unstable idle and unintended acceleration is due to a faulty idle air control valve (IAC). The powertrain control module (PCM) uses the idle air control valve to divert air around the throttle. Increasing the amount of air increases the idles peed, whereas decreasing the amount of air reduces idle speed. I recommend having a professional, such as one from YourMechanic, diagnose and repair your rough idle issue for you.