Section 12. All amounts received by such creditor from the proceeds of the sale of goods attached or taken on execution and afterward returned, or received by him for the value of goods not returned, or recovered from the officer for the insufficiency of the sureties on the bond, shall be applied to the discharge of the judgment recovered by the creditor; and all amounts received as interest or damages for the delay of his execution shall be applied, one half to the sole use of the creditor, and the other half in discharge of the judgment.