QQuickMenu: center menu when mouse not present

On touch platforms, QCursor::pos() will return the last
touch synthesized to a mouse pos. Since this will only
happen when the user taps on a control that does not
handle the touch, the position you get can easily be
very old. And in many cases, a mouse pos has never been
synthesized at all, and the position you get is inf.

As a quick fix, this patch checks if the mouse position is
invalid, and center the menu.

For a long term fix we need to find a way to expose touch events in
QGuiApplication, and write logic that determines when to use
touch and when to use mouse to position the menu, and if using touch,
which touch point should be used.

Change-Id: Ic4d2dd78372efcd0c2362204492e76f44ff0a49a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
QQuickMenu: dismiss platform menu, not only QQuickMenuPopupWindow

This patch will fill in the missing code path that tells a native
platform menu to dismiss when requested.

Change-Id: I2625fddd0a735ca9ec7fabaf783921a1f99caa1d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>