But the testimony so given shall not be used in any prosecution or proceeding, civil or criminal, against the person so testifying. A person so testifying shall not thereafter be liable to indictment or presentment by information, nor to prosecution or punishment for the offense with reference to which his testimony was given, and may plead or prove the giving of testimony accordingly in bar of such indictment, information or prosecution.