fixed file handle leaks due to go's odd socket/file handling