AsyncTask: avoid lifecycle-related crashes.