Fix race conditions in finalizer/weak link staging.