forward port SVN commit 572897 by tilladam:
forward port SVN commit 572897 by tilladam:

Don't crash when the imap slave goes away in the middle of 
flags uploading.

svn path=/trunk/KDE/kdepim/; revision=593394

lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi