Fixed #21255 -- Closed connections after management command ran

Thanks kabakov.as@gmail.com for the report.
I think this will create a new connection if the alias hasn't been used yet. What about:

```python
for alias in connections:
    try:
        connection = getattr(connections._connections, alias)
    except AttributeError:
        continue
     connection.close()
```