Documents reveal how officials’ underestimating a heat wave led to ‘lights out’ on Shanghai’s Bund.