Stability analysis of rotor whirl under nonlinear internal friction by a general averaging approach