fix crash on close in attribute table (layer cache already destroyed when model dtor is called)