win32: various win32 build fixes.
stream-file: ensure we account for the last read in return value.