Dick, in addition to the good info from Ascend and Overthawk, the pilot can choose his operating height to ensure a flyaway option for the aircraft during the winching - this gives the winch operator the option of cutting the cable or winching in fast, depending on what stage the engine failure occurs.
Winching safely requires lots of good quality training and constant practice because, even without the issue of engine failure, poor technique can take a winching scenario from 'easy-peasy' to 'f**k-me' in a matter of seconds.