QBinaryJson: avoid needless ref-count round-trip in detach()
Coverity complained about a USE_AFTER_FREE in these two functions,
because it sees clone() return `this` but doesn't understand that the
delete d can never happen if the x->ref() upped the refcount that
d->deref() then downs. So, False Positive, but the ref-count
round-trip it points at was, indeed, needless.
Skip the dance when clone() didn't actually give us a new object.
Pick-to: 6.12 6.11 6.8
Coverity-Id: 390809
Coverity-Id: 390817
Change-Id: I8d86321ee250c9acc1d424ee7bd6bca21b9ef443
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>