Fix testTypewriterAnnotTool

... by extending CloseDialogHelper to also handle dialogs without
a parent widget.
2 jobs for !52 with arcpatch-D15348 in 15 minutes and 3 seconds
detached
Status Job ID Name Coverage
  Build
passed #18738
build_ubuntu_18_04

00:13:24

passed #18737
linux kf5-qt5 qt5.12

00:15:03

42.0%