fdo#71450 fdo#71698: ODF import: fix frame name corner cases

Trying to set a name that is already in use will throw an exception (and
set a different, generated name); if there is actually no name in the
file then there's no point trying to set anything.

(regression from b69d152cfa1da868ba960345d72ba78f9f8e1b35)

Change-Id: Ie54d4a830cc23e2853a6efeb81f77dcc788192ea
(cherry picked from commit 8171e713e74e3d09e86592c28abfe05d0400c071)
Reviewed-on: https://gerrit.libreoffice.org/6907
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 0763cf6ed7bdc629e59b5df757b9ef4f5273f393)
Reviewed-on: https://gerrit.libreoffice.org/6911
Reviewed-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>