- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.8-SNAPSHOT
* Operating System version: xxx
* Java version: xxx

### Steps to reproduce this issue

1. Do not start zookeeper server, which is used as a metadata center
2. start a provider

Pls. provide [GitHub address] to reproduce this issue.

### Expected Result

The app exit normally

### Actual Result

The app exit with a NPE

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

```
Exception in thread "DubboShutdownHook" java.lang.RuntimeException: java.lang.NullPointerException
	at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:48)
	at org.apache.dubbo.common.lang.ShutdownHookCallbacks.lambda$callback$0(ShutdownHookCallbacks.java:70)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.apache.dubbo.common.lang.ShutdownHookCallbacks.callback(ShutdownHookCallbacks.java:70)
	at org.apache.dubbo.config.DubboShutdownHook.callback(DubboShutdownHook.java:85)
	at org.apache.dubbo.config.DubboShutdownHook.run(DubboShutdownHook.java:73)
Caused by: java.lang.NullPointerException
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.unexportMetadataService(DubboBootstrap.java:1009)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.destroy(DubboBootstrap.java:1188)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap$1.callback(DubboBootstrap.java:198)
	at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:46)
	... 5 more
```

import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Consumer;
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.REGISTRY_SPLIT_PATTERN;
import static org.apache.dubbo.common.constants.CommonConstants.REMOTE_METADATA_STORAGE_TYPE;
import static org.apache.dubbo.common.extension.ExtensionLoader.getExtensionLoader;
import static org.apache.dubbo.common.function.ThrowableAction.execute;
import static org.apache.dubbo.common.utils.StringUtils.isNotEmpty;
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.
 * <p>
 * The bootstrap class of Dubbo
 * <p>
 * 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 {