In the event of a foreclosure under a deed of trust, the lender may cancel an insurance policy covering the foreclosed property and is entitled to any unearned premiums from the policy if the lender:
(1) credits the amount of the unearned premiums against any deficiency owed by the borrower; and
(2) delivers to the borrower any excess unearned premiums not credited against a deficiency under Subdivision (1).