ensure that the copy process is properly terminated in case of client si...

...de or server side failures

by using conn#copy_data with a block instead of exec