SERVER-9516 Fix use-after-free in unit test.