Fixed corruption of settings file on Windows

Fixed exclusive file write in Settings.configure to flush io before
truncation and use resulting file position over number of bytes written
by IO#write.

Bug: 69932
Change-Id: I807dac564ed52e672eb92595c1f2895007180613