Magnetocrystalline anisotropy of Fe, Co, and Ni slabs from density functional theory and tight-binding models