In all cases where a sheriff, coroner, or other officer, shall by virtue of an execution, levy upon any goods and chattels which shall remain upon his hands unsold, for want of bidders, for the want of time to advertise and sell, or any other reasonable cause, the officer may, for his own security, take of the defendant an undertaking, with security in such sum as he may deem sufficient, to the effect that the said property shall be delivered to the officer holding an execution for the sale of the same, at the time and place appointed by said officer, either by notice given in writing to said defendant in execution, or by advertisement, published in a newspaper printed in the county, naming therein the day and place of sale. If the defendant shall fail to deliver the goods and chattels at the time and place mentioned in the notice to him given, or to pay to the officer holding the execution, the full value of said goods and chattels, or the amount of said debts and costs, the undertaking, given as aforesaid, shall be considered as broken, and may be proceeded on as in other cases.