automatically activate persistent mode on opening context menu, deactivate it when alt key is pressed

Having Alt-Tab automatically close after a menu closes and the alt key is not down can lead
to surprises. On the other hand, persistent mode can also be suprising, so deactivate persistent mode when the alt key is pressed again.