fix jails shutdown sequence

Ticket: #4851