Fix socket finalizer test to not depend on GC actually happening