Dynamics of discontinuity formation in a cavitating liquid layer under shock wave loading