Fix a test that fails if previous tests have open cursors