The energy budget and figure of Earth during recovery from the Moon-forming giant impact