Close source file after copy.

Reported by Satoshi Nagayasu on pgsql-hackers.