Fix a file descriptor leak in openFile: if openFd fails, then we weren't closing the newly created descriptor.