[asan] Fix invalid thread registry access when checking if LSan is disabled.