fixes for up-casting to Reference<XInterface>

Fix regressions introduced with
6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 "Use the new type-checking
Reference constructor to reduce code noise"

Change-Id: I85662856f21c810a7db497fe3b0e116f075b1687
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>