Path-integral calculation of the third virial coefficient of quantum gases at low temperatures