If, after the proceeds of all the property attached have been applied to the payment of the judgment, any balance remains due, the sheriff shall proceed as upon an execution in other cases. Whenever the judgment has been paid, the sheriff, upon reasonable demand, shall deliver to the defendant the attached property remaining and the clerk shall pay to the defendant any remaining proceeds of the property attached that have not been applied on the judgment.