Two-loop superstrings and S-duality