Dynamic Contracting with Limited Commitment and the Ratchet Effect