Ensure backend has been closed properly, even if the user cancelled the dialog