fdo#75339: Substituting XInterface* eq. for object eq. requires queryInterface

Regression introduced with 6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 "Use the new
type-checking Reference constructor to reduce code noise" which should have left
(at least some) "querying upcasts" to XInterface alone.  Closer inspection of
that commit will probably turn up further regressions that need to be reverted.

Change-Id: Ib81afc12d9df205b5b0fe6cec6ce85d012e9629f
(cherry picked from commit f8115ce72dad45b82b044d9c8f5c253d0514574d)
Reviewed-on: https://gerrit.libreoffice.org/9875
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>