1508 | Fix crash when logout during sync

Sync task sometimes finishes in background, while the "Cancel" button is being shown