[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.
Can you add that this method is called while the shard lock is held to the javadocs for `IndexCloseListener.onShardClosed`? Currently it says "Invoked once the last resource using the given shard ID is released" which isn't accurate since the lock is still held