Small correction to the pthread return value check