added close(fd) to sum

The sum program now properly closes the open file handle
before exiting.