dump: check for failure to open file.
socket: remove use of goto in connect loop.
uri: explicitely set AF_INET6 when appending host.
stream-file: use requested flags, along with _O_BINARY on win32