Constraints on Quenching of Z ≲ 2 Massive Galaxies from the Evolution of the Average Sizes of Star-forming and Quenched Populations in COSMOS