Credit, Endogenous Collateral and Risky Assets: A DSGE Model