W-symmetry and the rigid particle