[IMAPx] Deleted messages not always saved to the server properly

This is an outcome of investigation of bug 734300, but it probably
does not fix that bug as such, only something similar.