Avoid concurrent use of the scratch buffer in copyin.Close

This should fix the problem I managed to reproduce in #235.  I'll have to do another pass over that code to see if there are other similar problems or if something else could explain the Travis failure, but I think we should commit this in the meanwhile.