How do you handle multi-threading and concurrency when saving data locally to avoid blocking the main thread?