Brazil has become a solid free-market democracy, a rare island of stability in a region of turmoil and governed by the rule of law instead of the whims of autocrats.