Merge "Surface the log write errors to StatsLog.write" into pi-dev