Fix mongo not being closed when multiple loaders were present.