When a writ of habeas corpus cum causa issues and the sheriff or other officer to whom it is directed returns upon the same that the prisoner is condemned, by judgment given against him, and held in custody by virtue of an execution issued against him, the prisoner shall not be let to bail but shall be presently remanded, where he shall remain until discharged in due course of law.
N.C. Gen. Stat. § 17-36