Structure and magnetism of Mn, Fe, or Co adatoms on monolayer and bilayer black phosphorus