Gauff thwarts Osaka fight-back to reach San Jose WTA quarter-finals