Don't propagate the mousdown event when any flyout is closed

Fixes #1411