ACTUAL CAUSE AND SOLUTION
-----------------------------------------------------
As an engineer in a lab and a programmer as well, I once thought it was a specific problem. After having 3 of these (can get them cheap on eBay or Amazon)...I finally did the work to figure it out for sure. my first conclusion was close, but here it is...
The cause of the problem seems to be the chip that the battery charger uses. This chip is in all phones and works outside of the O/S (so it is not actually a Windows problem). Due to the thinness of the phone, the phone flex and this chip either from a trace or some other cause puts the chip in a false state. For instance, this problem always happened when I put the phone in my pocket.
The phone in this hardware state then thinks it is not charging. So step 1 in fixing it is to let the phone completely die (i.e. use up all its power)--BUT DO NOT LEAVE IT ON A CHARGER AS IT STILL MAY CHARGE IN TIS STATE AND NEVER POWER DOWN. Depending on the what the charge was in the phone when the problem started, it will discharge quick or a very long time.
Once it is discharged, plug it back into the charger and it will revive. At first because it is totally dead, it will have to charge for a very short bit before it will boot up, but when it does it is good again! Why does this work? Because the battery chip needs to be rebooted and since it is directly connected to the battery, it will not reboot until it is completely drained of power. Of my three phones, this happened many times (as I let them just our of curiosity of the problem). Finally one of them got wet and died...ooops...unrelated to this problem.
I tried this with Windows 8 and also 8.1...of course both worked as this problem is O/S independent. It is a hardware problem due to the thinness of the phone and like a speculate a thin trace as well. Now for a solution...
I liked the thinness as it slipped in and out of my pocket easily. I just quit putting it in my jean's pocket. Finally I ordered an Otterbox for one of them and it was still thin enough to use in my pocket, but rigid enough not to flex--problem solved. With that phone with the Otterbox, I never had the problem again after having it all the time.