First-principles study of the B- or N-doping effects on chemical bonding characteristics between magnesium and single-walled carbon nanotubes