viewDidDisappear may be called when a file is successfully selected.
presentationControllerDidDismiss is only called when the controller is
dismissed manually by the user, e.g. by tapping outside the sheet, or by
dragging it away.
Checking for sheet dismissal is necessary in iOS 15, but not in iOS 17.
In iOS 17, tapping outside the file chooser causes a callback to
documentPickerWasCancelled instead.