No prisoner or person under recognizance who shall be acquitted by verdict or discharged because no indictment is found against him or her, or for want of prosecution, shall be liable for any costs or fees of any officer or for any charge of subsistence while he or she was in custody, but in every such case the fees of the defendant's witnesses, and of the officers for services rendered at the request of the defendant; and charges for subsistence of the defendant while in custody shall be taxed and paid as other costs and charges in such cases.