Update task status.