A Model of the Lender of Last Resort