[CORE] Ensure shards are deleted under lock on close

Today there is a race condition between the actual deletion of
the shard and the release of the lock in the store. This race can cause
rare imports of dangeling indices if the cluster state update loop
tires to import the dangeling index in that particular windonw. This commit
adds more safety to the import of dangeling indices and removes the race
condition by holding on to the lock on store closing while the listener
is notified.
I'm not sure I follow here, if there are no locks for an index and it's not part of the index metadata, isn't it supposed to be a candidate for auto-import?

Or, will there always be locks in the `shardLocks` list if the candidate is a dangling index we should import?