Section 37. If a mortgage is held by the commonwealth, the state treasurer may demand and receive the money due, and upon payment shall make and acknowledge a discharge.