When a person is produced before the court in habeas corpus proceedings, the judge may, until judgment is given, commit such person to the custody of the sheriff or place him in such care or under such custody as the circumstances of the case may require.
N.J.S. § 2A:67-26