fix KFileDialog crashes (fdo#69002)

Requires Qt patches (or otherwise LO generic file dialog is used).
Squashed from several master patches.

(cherry picked from commit 2cd8a1e0f1e81efd15979953d7f274ab8a6806d6)
(cherry picked from commit 474ad6b0e2fb18370be9d228456a2abbfc15bad2)
(cherry picked from commit e809aa1e916e0f6d1a849d0374f59ef9619b1db7)
(cherry picked from commit 65a3622148ea67744c9c1fc18c2b8d48e5f1c79f)
(cherry picked from commit 508337db0c53caa5fb43ef26f781df159497a482)
(cherry picked from commit 9aa32a34c7c7a2ee4da5f01983a0ed224c38c875)
(cherry picked from commit 145f2e970f46a3a3e5456b122d71f17c3abe878f)
(cherry picked from commit f09d4bc2853be2fa3faa0502b8efe94ad9719731)

Change-Id: I6dba5da0170fb94bab928f71efc7dc8c03cc70d9
Reviewed-on: https://gerrit.libreoffice.org/9206
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>