Analysis of plasma loss in a ring-cusp ion thruster