Fixed IMAP UID implementation to conform to RFC 3501
Fixed concurrency problem