Save side bar visibility immediately when not in resizing.

This fixes #7030.