properly terminate test dialogs so we can look for leaks as part of testing