darwin: call pthread_setname_np() if available

When setting the process title, also call pthread_setname_np() when
supported (OS X >= 10.6 and iOS >= 3.2.)