liblog: save errno through log writing

(cherry picked from commit 72d3724ee57251e4056df95f58a55f0c9e2ab31c)

Test: compile
Bug: 74258013
Change-Id: I5163527826855bc506ed324aaba47f8695aaf668
1 file changed