Influence of MgO codoping on Er concentration in congruent LiNbO_3 crystal: Mg threshold concentration effect