S3 backend and some Win32 cherry-picks from upstream