Decoherence and dissipation of a quantum harmonic oscillator coupled to two-level systems