Costly monitoring, financial intermediation, and equilibrium credit rationing