Rewrite messagesForSet to fix some memory leaks on the error paths, and
make it easier to read in general.

The mailimap_set would be leaked if the call to [self connect] failed,
or any of the mailimap_fetch_att allocations.

Also, insert checks for places where memory allocations can fail.  This
affected the mailimap_fetch_att allocations
Update libetpan to get a recent bugfix for a memory leak.