**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

{
        new_query->table_id = StorageID(getRemoteDatabaseName(), getRemoteTableName());
    }
    const auto & cluster = getCluster();
    const auto & shards_info = cluster->getShardsInfo();
    std::vector<std::unique_ptr<QueryPipeline>> pipelines;
    String new_query_str = queryToString(new_query);
    for (size_t shard_index : collections::range(0, shards_info.size()))
    {
        const auto & shard_info = shards_info[shard_index];
        if (shard_info.isLocal())
        {
            InterpreterInsertQuery interpreter(new_query, local_context);
            pipelines.emplace_back(std::make_unique<QueryPipeline>(interpreter.execute().pipeline));
        }
        else
        {
            auto timeouts = ConnectionTimeouts::getTCPTimeoutsWithFailover(settings);
            auto connections = shard_info.pool->getMany(timeouts, &settings, PoolMode::GET_ONE);
            if (connections.empty() || connections.front().isNull())
                throw Exception(
                    "Expected exactly one connection for shard " + toString(shard_info.shard_num), ErrorCodes::LOGICAL_ERROR);
            
            auto in_stream = std::make_shared<RemoteBlockInputStream>(std::move(connections), new_query_str, Block{}, local_context);
            pipelines.emplace_back(std::make_unique<QueryPipeline>());
            pipelines.back()->init(Pipe(std::make_shared<SourceFromInputStream>(std::move(in_stream))));
            pipelines.back()->setSinks([](const Block & header, QueryPipeline::StreamType) -> ProcessorPtr
            {
                return std::make_shared<EmptySink>(header);
            });