On stability of electromagnetic oscillations in media with cubic nonlinearity