Mechanisms of thermal electron capture by hydrochloric and hydrobromic acids