fixed a test case that could fail in the "check leak" mode due to GC delays.