Sets a new value of the closed flag. The closed flag indicates whether the shell is closed (true) or not (false).