Call trimChats when the window is resized.

Also fixed 2 bugs.

1. Instead of checking whether minimized chats toggle is visible, check whether
there ae aleady minimized chats (visuals might be delayed).
2. Don't call restore from removeChat. Chat gets restored earlier.
Try to fix some corner cases resulting from narrow window widths.