Fixed #21255 -- Closed connections after management command ran

Thanks kabakov.as@gmail.com for the report.
Yeah hiding it in `ConnectionHandler` would make more sense.