**Describe the bug**

Can't rename distributed table and move it from Ordinary to Atomic database

**How to reproduce**

```
CREATE DATABASE atomic_database ON CLUSTER cluster_name ENGINE = Atomic
```
```
CREATE DATABASE ordinary_database ON CLUSTER cluster_name ENGINE = Ordinary
```

```
CREATE TABLE ordinary_database.t ON CLUSTER cluster_name
...
ENGINE = ReplicatedMergeTree(...)
...
```

```
CREATE TABLE ordinary_database.distributed_table ON CLUSTER cluster_name AS ordinary_database.t 
ENGINE = Distributed(cluster_name, ordinary_database, t)
```

```
RENAME TABLE ordinary_database.distributed_table TO atomic_database.distributed_table

Query id: 7bd2101e-f78a-4584-8374-6e44a0bbf23f


0 rows in set. Elapsed: 0.011 sec.

Received exception from server (version 21.5.6):
Code: 1000. DB::Exception: Received from clickhouse-server:9000. DB::Exception: File not found: /var/lib/clickhouse/data/ordinary_database/distributed_table.
```
But 
```
ls -lh /var/lib/clickhouse/data/ordinary_database
total 0
drwxr-x---  2 ...  staff    64B Jun  4 18:19 distributed_table
drwxr-x---  4 ...  staff   128B Jun  4 18:18 t
```

**Does it reproduce on recent release?**
Checked on 21.5.6.6 version


**Expected behavior**

For example, renaming _Views_ works perfectly. I expect the same from the _Distributed_ table

throw Exception("optimize_skip_unused_shards_limit out of range (0, {}]", ErrorCodes::ARGUMENT_OUT_OF_BOUND, SSIZE_MAX);
    }
    
    ++limit;
    const auto blocks = evaluateExpressionOverConstantCondition(condition_ast, sharding_key_expr, limit);
    if (!limit)
    {
        LOG_DEBUG(log,
            "Number of values for sharding key exceeds optimize_skip_unused_shards_limit={}, "
            "try to increase it, but note that this may increase query processing time.",
            local_context->getSettingsRef().optimize_skip_unused_shards_limit);
        return nullptr;
    }
    
    if (!blocks)
    {
        return nullptr;
    }
    std::set<int> shards;
    for (const auto & block : *blocks)
    {
        if (!block.has(sharding_key_column_name))
            throw Exception("sharding_key_expr should evaluate as a single row", ErrorCodes::TOO_MANY_ROWS);
        const ColumnWithTypeAndName & result = block.getByName(sharding_key_column_name);
        const auto selector = createSelector(cluster, result);
        shards.insert(selector.begin(), selector.end());
    }
    return cluster->getClusterWithMultipleShards({shards.begin(), shards.end()});
}
ActionLock StorageDistributed::getActionLock(StorageActionBlockType type)