Commodity terms of trade shocks and political transitions