Japan scrambles to avert power crunch amid record heat wave