cairo: Do not set an invalid matrix in drawImage()

https://bugs.freedesktop.org/show_bug.cgi?id=70085
Return empty if getXRef()->copy() fails

Seems this can happen by looking at the backtrace in https://bugs.kde.org/show_bug.cgi?id=325810
Merge remote-tracking branch 'origin/poppler-0.24'