A relieved Caroline Wozniacki progressed to the last eight of the ASB Classic in Auckland, after being given an almighty scare by teenager Taylor Townsend.