possible deadlock fixed when using --copy

a deadlock could occur when the following curcumstances were met:

- using the --copy option
- the remote command expects input, eg. a password prompt

tags: relevant