How do you handle local data persistence and offline synchronization in a mobile application without blocking the main UI thread?