Store finalizers as a linear list. jl_finalize is now a lot slower (O(registered_finalizers)) but registering a finalizer is faster.