The plaintiff shall not proceed to foreclose his or her mortgage while he or she is prosecuting any other action for the same debt or matter which is secured by the mortgage, or while he or she is seeking to obtain execution of any judgment in such other action; nor shall he or she prosecute any other action for the same matter while he or she is foreclosing his or her mortgage or prosecuting a judgment of foreclosure.