Avoiding long propagation times in wave packet calculations on scattering with resonances: A new algorithm involving filter diagonalization