Measurement of the time-dependent CP-violating asymmetry in B0→KS0π0γ decays