Spurious dipole mode in random-phase approximation and in the RPA-based models