The number of beaches in Wales where the water quality is high has increased by 40% in the last 10 years, figures have revealed.