curses: Factor out dialog release to separate function.
* pinentry/pinentry-curses.c (dialog_release): New. (dialog_run): Use unified cleanup function to avoid code duplication and memory leaks.
- GnuPG-bug-id: T7218
- Signed-off-by: Jakub Jelen <jjelen@redhat.com>