Deal ends a legal battle that had exposed the disgraced financier’s close ties to the bank and the island territory.