QNdefRecord: fix construction from an empty record
A default-constructed QNdefRecord has its d_ptr == nullptr.
However, all classes derived from QNdefRecord implemented their copy
constructors with the assumption that d_ptr is non-null.
This caused a crash when copy-constructing from a default-constructed
QNdefRecord.
Fix by adding proper checks.
Amends 29ba8297443cf76d4f647bde329d62c2a567c709 (beginning of the
public history for the module)
and db2fc63155e8c821f5c6c751a33974cab9cb4ed3 (5.2)
Fixes: QTBUG-151318
Pick-to: 6.12 6.8 6.5 5.15
Change-Id: I385d89dcd8742bb96203c19e45ff26c407c00519
Reviewed-by: Mate Barany <mate.barany@qt.io>