Financial Intermediation versus Stock Markets in a Dynamic Intertemporal Model