Fix leaking FD

See #1289 
copyBytes is implemented in terms of io.Copy()