Use thread-safe errno on Solaris