Main Thread, Sync vs Async and Deadlocks in Swift