Fix memory leak in imap_copy_messages().
mx.mbox (allocated by imap_parse_path) was not always freed before return. The sync_cmd and cmd buffers were also not always freed. One case was on retrying after creating the mailbox, which would overwrite the allocated pointers. As long as I'm touching the buffers, convert them to use the buffer pool. I think the mutt_buffer_clear() at the beginning of the retry loop isn't necessary, but will keep it to make it clear any existing values won't be reused a second time through the loop.
Showing with 18 additions and 14 deletions