Replace twisted thread with QThread.

This fix the bug that prevents pastebin to work.
Closes #5949.
Merge remote-tracking branch 'refs/remotes/ivan/bug/pastebin-does-not-work' into develop