Endogenous Fluctuations and Social Welfare under Credit Constraints and Heterogeneous Beliefs