CLI AS7-1833 connection management for shutdown and reload operations

The second attempt which should fix testsuite hanging issues.

Thanks,
Alexey