Fix thread names.

The prctl() call we were using politely truncates overly-long strings.
The pthread_setname_np() call returns ERANGE.  This adds a buffer
copy to create a truncated string.

I'm strongly tempted to just back out the previous change and go
back to using prctl(), but there's probably some value in using a
pthread call, even if it is _np (and appears to exist but declared
differently on other platforms).

Change-Id: Ib692ea0e225f691e4888b27883c61f7701272245
1 file changed