I agree with Cigroller that the first step will be to try to scan for stored codes.
I think what you're doing when you disconnect the mass airflow sensor is partially compensating for a poor fuel metering problem, causing it to idle a bit longer before shutting down. Bottom line, I think you have a fuel delivery problem. Either a plugged filter (low probablility), a bad fuel regulator (low probability), or a dying fuel pump (high probability).
A bad temp sensor or manifold absolute pressure sensor are IMHO low probabilities but possibilities.
It dying when you give it gas is a clue to me. That's telling me that the ECU may be reading the throttle position sensor and lengthing the injector pulsewidth but rather than giving the engine more gas it's simply dropping the small amount of fuel pressure that exists, starving the engine.
In short, check your fuel supply line pressure and post back.