ui: Trap "back" and "cancel" (escape) in popup requests

Fixes #2129