Handle screen rotation, cancel tasks when destroyed