Can't clone object with no id

Reported by @mwoehlke and split out here

Steps to reproduce:

  • open Inkscape
  • create a rectangle
  • open the xml editor
  • select the rectangle and delete it's id
  • clone the rectangle (Alt+d)

What happened?

  • Use element created that references #(null)

What should have happened?

  • rectangle has an id generated and clone references that.

Version Info:

  • Inkscape 1.0.2 (16c81841, 2021-03-16) Linux Mint 20
  • Inkscape 1.2-dev (12564cb3, 2021-04-22) Linux Mint 20
  • Inkscape 0.92.5 (0ad1ac96, 2020-08-06) Linux Mint 20