Ensure UI is syncronized with legend item state

The print composer UI for the legend would not get properly updated when undoing/redoing.

Funded by Sourcepole QGIS Enterprise.