To put an end to. A legal term, meaning to close before the time specified; e.g. suppose I held the mortgage of a man called A, and A fails to fulfil his part of the agreement, I can insist upon the mortgage being cancelled, foreclosing thus our agreement.
“The embargo with Spain foreclosed this trade.” —Carew.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894
More on Foreclose from Infoplease: