Williams battles into Open quarter-finals