dialog: reset local variables shortcuts after reply and failure processing

- avoid using wrong values to find dialogs with processing of next messages
- reported by Julia Boudniatsky
- backport of:
  dcdb73d792719e38844eef60f821365b587893d7 (master)
  8a6660697bf08d0522fcd7ffa60698ebcdc4f990 (4.2.)