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>