Dynamical invariants and quantization of the one-dimensional time-dependent, damped, and driven harmonic oscillator