Naomi Osaka won the third Grand Slam title of her career after beating Victoria Azarenka in three sets at the US Open.