netrc: Fixed a memory and file descriptor leak on OOM