Fixed race condition when syncing huge amount of deleted messages using AS