Self-oscillation conditions of a resonant nanoelectromechanical mass sensor