ui: proxy protect/restorestdio() calls to update internal flag
It should be better to manage the redirection flag solely by the ui class.