Interaction of H− ions with foil targets in the charge exchange system of a beam transport channel