Fix IMAP cx reestablishment logic: Closes bgo#723955

The internal Imap.Folder object was not being closed in all code
paths, causing the re-open to fail every time.  Solution is to
properly close the object and to distinguish between soft and hard
failures when opening a connection to the server.