If many docs close we trigger too many proxy model invalidations resulting in a very slow to shutdown kate (cherry picked from commit 5103f933)