A general equilibrium theory of banks' capital structure