dialog: backup and restore exiting route type when executing dialog event_route blocks

- reported by Nuno Miguel Reis

(cherry picked from commit 4fab97fb54334a55b1fce4e0d2f417fda5727c3a)