So the trick is to look at the net current in the cable and if it goes over zero take action to disconnect.
There's still a fundamental gap in that design, though (aside from being able to effectively isolate 250VAC from the case in a device 6mm thick): It requires that the phone itself be capable of completely isolating its case from the shield of the charging cable to be safe from a crappy charger. To my knowledge even GFCI outlets don't disconnect the ground when tripped.
On one hand, having such isolation would allow the hypothetical GFCI iPhone to break the connection between the 5V Lightning/30-pin-dock-connector ground and its case in the event that current between the shield and the 0/+5V pins did not add to zero. On the other, I don't know how feasible that is, given electrical shielding and grounding requirements.
I just checked with a meter, and the shield on the Lighting cable is indeed directly connected to the USB outer shield on the other end, and that is in contact with the computer case and the iPhone case. So you should have a solid EMF shield running from the guts of the phone, through the cable, to the guts of the computer (if there is one on the end). In just about every signaling and electrical environment I've ever worked with, that's exactly what you'd expect for cable and case ground.
An Apple charger--like you'd expect from any decent USB charger--puts significant isolation between the USB shield and either AC input. In a computer case, it's of course grounded to case ground, which should be directly connected to building ground.
A crappy charger, however, could fail internally and show AC to the USB shield, which of course goes straight through to the case of the phone and becomes very dangerous--probably exactly what happened in these cases (maybe coupled with a bad building ground). It would require either an entirely different charging cable--with a non-continuous shield, if that's even possible from a noise rejection standpoint--or with some sort of fusible connection between cable ground and the chassis of the phone to prevent that situation.
It's analogous to your toaster oven or any other grounded appliance: The ground pin of the outlet is connected directly to the metal case of the device internally. So long as building ground is fine, then if something goes horribly wrong internal to the device, any excess current is dumped to ground instead of the user. But if building ground is faulty--say, it's wired to hot--then the case is going to fry whoever touches it (had an ungrounded VCR that a cat peed in with a case at +50VAC once, for example).
The iPhone's design is essentially the same, operating under the assumption that the USB shield is "safe" relative to earth ground--either floating or grounded through the computer chassis, if the device it's connected to is grounded. Having that assumption broken is so far out of design spec that it's unrealistic to design for in a device like a phone, just like most appliances aren't designed to deal with a building wiring fault of hot ground.
Which seems to be a reasonable assumption, given that they ship with a safe charger and out of the 400+ million iPhones, 75+ million iPod touches, and 100+ million iPads sold, there have been three reported deaths or very serious injuries that have made it to at least the news I read, all of which appear to have been from faulty 3rd party chargers, a serious injury rate of about 1 in 200 million devices; what percentage of those were actually being subjected to a dangerous charger is hard to guess.
For comparison, looking at statistics for dryers in the US in 2010 alone: Random electrical failure or malfunction killed about 4 people, injured 28 people, and burned down $17M worth of houses. Random mechanical problems with dryers killed 10 people, injured 77, and burned down $48 million worth of houses.