The real problem here is the utter insufficiency in determining when a person is really alive or dead.
^ This is the heart of the issue. Same with other dilemmas. Said differently, when does this thing become a human, and when does it cease to be a human?
I recall reading a sci-fi book back in the 70's, about a guy who was in a vegetative state. He was being kept alive on a machine, and unable to communicate. But his mind was still good enough that he could think logically. So, much of the story was about his thought process; whether or not he wished he were dead, and how this compares to a person who has good physical health but no mind. Sorry that I could not find it via Google. But it was an interesting read that got you thinking.
If a machine is faking a heart beat on an lump of rotting meat, then by all means pull the plug. But if there is still a functioning brain that lost connectivity with the body, then the decision becomes more difficult. In my case, if I'm capable of reasoning, then I'd just as well spend the rest of my life daydreaming while keeping a distant hope that I could someday be connected up to some sensors and actuators. But I can understand how many people would prefer that someone pulls the plug.
Either way, a living will would help a lot, and save the prospective plug-puller a lot of anguish.