Run gc.collect() twice in threaded leak tests