ok i know this is an old thread but since this issue happened to me just today and i found a better way to actually turn off the darn thing, and it's better because you don't have to mess around with the hardware like open the phone or anything like that. so i thought i'd share with the whole wide world.
first off, like one user said, if the darn screen is black, it's kinda hard to gauge whether or not you let go of the button fast enough to avoid a reset. so how to avoid said reset and still manage to turn off this POS?
1- open iTunes on your computer
2- connect phone to computer
3- wait for iTunes to recognize phone is connected
4- backup freakin' POS phone
5- follow above mentioned turn-off procedures, namely hold down HOME and on/off button AND here PAY ATTENTION:
--> the phone will disappear from iTunes device list
therefore, AS SOON AS the iphone disappears from the iTunes device list, release both phone buttons--you have now turned off your phone without accidentally resetting it.
as for me, Apple annoyed me off so much, i am done with them and my next phone will be a Nexus or HTC Android device.