Explain how Kotlin Coroutines manage thread dispatching and how you prevent memory leaks when using them within lifecycle-aware components.