Fire in Dunedin destroyed three buildings, threatened homes