Rotational spectrum and hyperfine structure of the 2Σ radicals BaF and BaCl