Perform thread lookup after RefreshStateAfterStop()

This fixes a crash on FreeBSD