Consistent calculation of the stopping power for slow ions in two-dimensional electron gases