On Strategic Commitment: Contracting versus Investment