More properly handle rotation during background tasks.