Ducks avoid late collapse against Stars to take Game 1