QNdefNfcSmartPosterRecordPrivate: use std::optional
The class was using raw pointers to represent the values that
can be potentially missing from the SmartPoseter record.
Managing raw pointers can be a source of memory leaks. One such
bug was already identified and fixed in
274b9ea625f6419abac0f320ac5d78141d294d48.
But that patch overlooked another problem - setPayload() was still
leaking the memory if the incoming payload had more than one uri,
action, size, or type record.
Use std::optional to prevent any raw memory allocations. This
also means that we do not need to call cleanup() in the Private's
destructor anymore.
As a drive-by, add the missing includes to the header.
Pick-to: 6.12 6.8
Change-Id: I8fae006fb76a67ec73bac520f6fc44a4d61d2b67
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>