The lender of a thing for use may at any time require its return, if the loan was gratuitous, even though he lent it for a specified time or purpose. But, if, on the faith of such loan made for a specified time or purpose, the borrower has acted in such a manner that the return of the thing lent before the time agreed upon would cause him loss exceeding the benefit actually derived by him from the loan, the lender must, if he compels the return, indemnify the borrower for the amount in which the loss so occasioned exceeds the benefit so derived.