World number one Caroline Wozniacki got the perfect boost ahead of the US Open, by winning her 18th WTA singles title at New Haven.