The court, judge, referee, or other person before whom the attendance of the witness is required may discharge a witness from an arrest made in violation of AS 09.20.150.