move this logic to the destructor, like we do elsewhere Change-Id: Ie41c78b0a01d79020cb77fd5be70116f473e910f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174747 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>