[TEST] fix a NPE in verifyThreadNames which may happen if thread finishes during sampling