No prisoner, charged with a criminal offense, shall be removed by a writ of habeas corpus out of the county in which he is confined, at any time within fifteen days next preceding the term of court at which such prisoner ought to be tried, except it be to convey him into the county where the offense with which he is charged is properly cognizable.
§ 532.230, RSMo