As its greatest old buildings were falling down, a fearless historian named Eusebio Leal remade the city into a stunning world destination