macos: preference tree fixes
- Fixes multi-free's upon destruction.
- Fixes some issues where things can get misplaced in the tree.
- Fixes plugin option sets incorrectly appearing in multiple places in the tree if their sets contain multiple subcat items.