Fix NPE when DesignContextMenu.close occurs without an attached desktop.