A Theory of Capital Controls as Dynamic Terms-of-Trade Manipulation