Denny Hamlin wins at Talladega after last-lap wreck