dialog: prevent the same reply from changing the same state twice

(cherry picked from commit 1290571f73571b00decce354796b1ff982d9fad0)