To be honest I think the problem may be a bad power supply from your electricity supplier. The frequency of the network is either not very stable, or it contains a lot of spikes and dirt...
I have the same problem with the power brick on my Powerbook G4. When ever I used to plug this in on board an ocean going ship (I worked in the marine industry) then it would switch itself of regularly. (the network on board contained spikes etc, and fluctuated as the generators are affected by the motion of the ocean to a degree). At home I have a fairly clean source, and no problems at all.
It does seem to me though, that the iPhone brick is ultra sensitive to this type of stuff, and it could very well be that in the Apple store most sockets are fed via some sort of power conditioner, hence it doesn't happen there.