The writ of habeas corpus shall be returnable forthwith, or on a particular day within a reasonable time, and at a place to be named by the judge granting the writ. But when granted by a circuit judge or chancellor, on the application of any person in custody, before conviction upon a criminal charge under the laws of this state, the judge or chancellor shall cause the writ to be made returnable at a convenient place in the county in which the offense is alleged to have been committed, unless so doing will interfere with his holding of a term of court.