This (and the `fstat` check above?) would still leak the file descriptor AFAICS