Preparation of ω-hydroxynonanoic acid and its ester derivatives