China scored two goals in four second-half minutes to complete the turnaround against Thailand and reach the quarter-finals with a 2-1 victory.