[base] LogFile: improve reliability and make use of writev()