Effect of stoichiometry on the structural properties and the electronic structure of intermetallics: Anti-phase boundary energies in FeAl and NiAl