DC: add check if shell is closed

Change-Id: Ie87fe9f415f86f8ea305e9580ac3df2f43da6d16