Toolbar: fix icon switch during state change
When many states are set on an item, the icon is deleted when the state
is changed. This shouldn't be as it leads to an unstable state whose
icon is still considered as existing and errors displayed on the screen.
We need to check that the icon is not used inside any state to permit its
deletion. Otherwise we should just hide it.