Credit constraints, firms' precautionary investment and the business cycle