base logging: fix errno restoring, severity conditionality, dangling ifs

Fix LOG() to properly save and restore errno. Test this properly.

Only do logging if severity is >= the minimum.

Fix dangling if statements in CHECK(), CHECK_STR{EQ,NE}(). Test this
properly.

Fix base logging tests on Windows. All libbase_tests now pass on
Windows.

Change place to lock, so the lock can protect logging of all data in
LogMessage.

Change-Id: I7ff531c67ae10a99ef0a2bbfe279aa77282d5ae9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
3 files changed