A file stream now makes sure to only close its file descriptor once.