A theoretical study of surfactant action in the layer-by-layer homoepitaxial growth of metals: the case of In on Cu(111)