Add support for naming threads on Darwin
Work around iOS SDK missing prototype of `_NSGetEnviron()`