Implement error shutdown in Copy way

(cherry-picked from master)
In case of errors, the new implementation will ensure that main
process and children exchange a PP_FINISH message.
The main process will always broadcast FINISH to all children
and wait for them to terminate (or count replies: windows).
If a child process fails earlier, it sends FINISH to the main
process, which reacts by broadcasting FINISH to all children as
before ( but already counts the first FINISH: windows version).
The failing child waits for the FINISH reply from the main process
if the error code is not zero.