Higher-derivative harmonic oscillators: stability of classical dynamics and adiabatic invariants