Fix memory leak in QNdefNfcSmartPosterRecord


The pointers in QNdefNfcSmartPosterRecordPrivate were only deleted
in the QNdefNfcSmartPosterRecord::cleanup() method, but it was not
called at destruction. Rewrite the code to make sure that the
destructor of Private always cleans up the memory.

A more modern approach would be to use std::optional, but I leave it
for a follow-up patch, because I want this change to be picked down
to 5.15.

Fixes: QTBUG-136576
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I5ca3ae24d638e4b28bc4f5f92604ec0c1564b489
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
commit274b9ea625f6419abac0f320ac5d78141d294d48
parentf609bdb11324348335daa212df114a0d01f32370
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeTue, 6 May 2025 12:38:01 +0200