Add a hack to allow us to wait for the finalizer thread to exit using pthread_join...