__thread breaks build on MACOS

The __thread modifier breaks the build on MACOS (at least on Snow Leopard, gcc 4.2.1). 

As for thread safety, configure already prints:
```checking gethostbyaddr_r() syntax... BSD-style
configure: WARNING:  ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** 
checking gethostbyname_r() syntax... BSD-style
configure: WARNING:  ****** BSD-style gethostbyname might NOT be thread-safe! ******
```

regards