use a condition_variable to speed up termination, or we could spend up two seconds waiting to join the background thread Change-Id: I775a21f01eb55c7529304b5a9da3db157610be83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>