Density-functional calculations of the electronic structures and magnetism of the pnictide superconductors BaFeAs 2 and BaFeSb 2