Precise measurements of the KS -> gamma gamma and KL -> gamma gamma decay rates