fix invalid memory access related to temporary object

e.g. export of ooo116460-2.xlsx

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