Alas, a mystery I have spent many hours trying to figure out. Unfortunately for us both, I have come to believe there may be no way, except waiting for the battery to run out. The good new is, I have taken apart hundreds of iPhones that were turned on while I worked on them, and never had one break because of it.
When taking off the front panel, you never touch any electronics so that part is safe. Once that part is done take out all of the screws holding down the logic boards, the lift it up (even an 1/8 of an inch) to disconnect it from the logic board. Like I said I have never broken a phone by opening it when it was on, but as with all electronics it is smart to keep metal away from metal.