I managed to repair this fault. The cause: the keyboard flex cable is somehow misaligned in the socket, causing the “power-on/off” line, which should be 3.3volts, to be pulled down to 0.2volt, unless you hold down any key on the keyboard. The solution: split the flex cable into two parts – it has 28 lines, with the lines for the power button on lines 27 and 28 (counting from the left, and looking into the socket). Lines 26 and 27 are NOT connected on the flex, so I cut between lines 26 and 27 for about 2 inches. When I reinsert the flex cable, I make sure all the lines are aligned with the pins in the socket – splitting the flex into two allows you to do that. After that, reassemble everything, and there’s no more need to hold down a key to avoid the laptop powering itself off.