Fix crash when the DB import finishes afer the activity closes.