sha1_file.c (write_sha1_from_fd): Detect close failure.