Fix folder mapping KeyError when starting some IMAP syncs.

We were creating the {name: id} mapping for folders before we had
necessarily created folder objects for all folders belonging to an IMAP
account, which meant that sometimes we'd get a KeyError starting up the
sync because we couldn't find a Folder object for a given folder.