Fix EMQX graceful stop when there is an unavailable MongoDB resource present.