James Douglas, 2nd Duke of Queensberry, 1662 - 1711. Statesman