Issue #17990: Only modify include and library search paths when cross-compiling.
Issue #17981: Closed socket on error in SysLogHandler.