If any person summoned under the four preceding sections shall fail to appear and answer, or shall make any answers which are deemed by the commissioner to be evasive, or if having answered shall fail to make such conveyance, assignment and delivery as is required by such sections, such commissioner shall issue a writ directed to the sheriff of the county requiring such sheriff to take the debtor or other person summoned and to keep him safely until he shall make proper answers, or such conveyance, delivery or assignment as the case may be, and upon making such answer or such conveyance, delivery or assignment, he shall be discharged by such commissioner. He may also be discharged by the court from whose clerk's office the fieri facias or execution issued, or by the judge thereof in vacation, in any case, if the court or judge shall be of opinion that he was improperly or unlawfully detained in custody.