Lydia Ko birdies 18, holds on to win Olympic gold medal