liblog: save errno through log writing
am: df7a622c12

Change-Id: Ia7c36da5799d1196d9516e7749461b017e8014a1