A bug in LIB_MANAGER::LibraryExists() prevented a library removed from
the symbol library table from being removed from the tree view. Add the
proper check to SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().
This exposed another issue with synchronization between the library
table editor and the tree view which could lead to orphaned library
modifications and/or a segfault when the currently selected library was
removed from the symbol library table. Give the user a chance to save
or revert any changes before allowing changes to the symbol library
table.
Fixes lp:1821691
https://bugs.launchpad.net/kicad/+bug/1821691
(cherry picked from commit 028973d182)