[office] Avoid lockup when going back to mainview from a heavy PDF.

The PDFRenderThread would wait in its destructor for any pending
render thread jobs to complete which for some pdfs could mean tens of
seconds.

Solve this by clearing the queue and moving the relevant cleanup to
the thread itself so the GUI thread can continue even though there are
jobs pending.