Measurement of the KS mean lifetime from π+π− and π0π0 decays using KL decays to determine the acceptance