Ryan Preece wins Cup pole at Martinsville