Fixes infinite waiting when canceling wait menu

Fixes issue #1738.