Add macro for Mac OS X to avoid compile error with strerror_r

This pull request fixes #553.