Fixed the deadlock bug when sync'ing a IMAP folder in singlethread mode