When we free the global state at thread termination, we must also free the error message in order not to leak the string once per thread.