Dialogs: don't allow click passthrough when a dialog is showing

On Android and other non-windowing platforms, clicking outside the
dialog dismisses it if it is non-modal, but if it is modal we still
need to capture the click even though it will not dismiss the dialog.

Task-number: QTBUG-39339
Change-Id: I18e892d1ca9c7ed4bea44c462a84b48ca44915d0
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>