### Environment

* Dubbo version: 2.7.4.1
* Operating System version: Win7
* Java version: jdk8

### Steps to reproduce this issue

1. Dubbo 2.7.4.1 Use zookeeper registry, generic call reports an error: 'zookeeper not connected '.
2. Dubbo 2.7.3 no such problem

### Expected Result

Interface accessed successfully

### Actual Result

java.lang.IllegalStateException: zookeeper not connected

If there is an exception, please attach the exception trace:

```
java.lang.IllegalStateException: zookeeper not connected

	at org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.<init>(CuratorZookeeperClient.java:83)
	at org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter.createZookeeperClient(CuratorZookeeperTransporter.java:26)
	at org.apache.dubbo.remoting.zookeeper.support.AbstractZookeeperTransporter.connect(AbstractZookeeperTransporter.java:68)
	at org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter$Adaptive.connect(ZookeeperTransporter$Adaptive.java)
	at org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfiguration.<init>(ZookeeperDynamicConfiguration.java:62)
	at org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfigurationFactory.createDynamicConfiguration(ZookeeperDynamicConfigurationFactory.java:37)
	at org.apache.dubbo.configcenter.AbstractDynamicConfigurationFactory.getDynamicConfiguration(AbstractDynamicConfigurationFactory.java:33)
	at org.apache.dubbo.config.AbstractInterfaceConfig.getDynamicConfiguration(AbstractInterfaceConfig.java:315)
	at org.apache.dubbo.config.AbstractInterfaceConfig.prepareEnvironment(AbstractInterfaceConfig.java:290)
	at org.apache.dubbo.config.AbstractInterfaceConfig.startConfigCenter(AbstractInterfaceConfig.java:280)
	at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$null$7(AbstractInterfaceConfig.java:636)
	at org.apache.dubbo.config.AbstractInterfaceConfig$$Lambda$38/1374066265.get(Unknown Source)
	at java.util.Optional.orElseGet(Optional.java:267)
	at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$useRegistryForConfigIfNecessary$8(AbstractInterfaceConfig.java:620)
	at org.apache.dubbo.config.AbstractInterfaceConfig$$Lambda$37/1704237553.accept(Unknown Source)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.apache.dubbo.config.AbstractInterfaceConfig.useRegistryForConfigIfNecessary(AbstractInterfaceConfig.java:618)
	at org.apache.dubbo.config.AbstractInterfaceConfig.checkRegistry(AbstractInterfaceConfig.java:208)
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:378)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:329)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:250)
```

### Sample code

```
ApplicationConfig application = new ApplicationConfig();
application.setName("api-generic-consumer");
ReferenceConfig<GenericService> reference = new ReferenceConfig<>();
reference.setVersion("1.0.0");
RegistryConfig registry = new RegistryConfig();
registry.setProtocol(Constants.REGISTRY_ZOOKEEPER);
registry.setAddress("192.168.0.58:2181,192.168.0.59:2181,192.168.0.60:2181");
reference.setRegistry(registry);
reference.setTimeout(2000);
reference.setGeneric(true);
reference.setApplication(application);
reference.setInterface("com.xxxxx.api.IXxxService");
GenericService genericService = reference.get();
Object obj = genericService.$invoke("getXxx", new String[]{Long.class.getName()}, new Long[]{1L});
String json = JsonUtils.toJson(obj);
System.out.println(json);
```
import java.util.stream.Collectors;
import static java.util.Arrays.asList;
import static java.util.concurrent.Executors.newSingleThreadExecutor;
import static org.apache.dubbo.common.config.ConfigurationUtils.parseProperties;
import static org.apache.dubbo.common.config.configcenter.DynamicConfiguration.getDynamicConfiguration;
import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_METADATA_STORAGE_TYPE;
import static org.apache.dubbo.common.constants.CommonConstants.REMOTE_METADATA_STORAGE_TYPE;
import static org.apache.dubbo.common.function.ThrowableAction.execute;
import static org.apache.dubbo.common.utils.StringUtils.isNotEmpty;
import static org.apache.dubbo.metadata.WritableMetadataService.getExtension;
import static org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils.setMetadataStorageType;
import static org.apache.dubbo.remoting.Constants.CLIENT_KEY;
/**
 * See {@link ApplicationModel} and {@link ExtensionLoader} for why this class is designed to be singleton.
 *
 * The bootstrap class of Dubbo
 *
 * Get singleton instance by calling static method {@link #getInstance()}.
 * Designed as singleton because some classes inside Dubbo, such as ExtensionLoader, are designed only for one instance per process.
 *
 * @since 2.7.5
 */
public class DubboBootstrap extends GenericEventListener {
    public static final String DEFAULT_REGISTRY_ID = "REGISTRY#DEFAULT";
    public static final String DEFAULT_PROTOCOL_ID = "PROTOCOL#DEFAULT";
    public static final String DEFAULT_SERVICE_ID = "SERVICE#DEFAULT";
    public static final String DEFAULT_REFERENCE_ID = "REFERENCE#DEFAULT";
    public static final String DEFAULT_PROVIDER_ID = "PROVIDER#DEFAULT";
    public static final String DEFAULT_CONSUMER_ID = "CONSUMER#DEFAULT";
    private static final String NAME = DubboBootstrap.class.getSimpleName();