Alter filtering rules for optgroups

Altered filtering rules for optgroups
* Optgoup header is visible if at least one of its item is visible
* All optgroups items are visible if optgroup name satisfies filter
The resulting behaviour seems more consistent to me.