avoid using memory manager in pthread destructor

When a pthread exits, it will call the destructor function specified as
second argument to pthread_key_create. For some objects, this means
ThreadLocalOnThreadExit<T> which will simply delete the object.

In the case of BigintData, the destructor will try to access a property
for cleanup (freelist). Accessing this property requires a call to
pthread_getspecific. Calling pthread_getspecific from a pthread
destructor is undefined behavior and returns a nullptr on OS X
(and possibly BSD).

Let's avoid the need for pthread_getspecific by passing freelist as an
argument to destroy_freelist instead.