Use requestAnimationFrame when clearing thread-only emails in closeEmailViewer