talloc: use a library destructor instead of atexit() if available