assorted fixes that only apply to 5.15
Fix compilation with g++11 and fix a memory leak in the qoffscreen platform plugin.
This cherry picks two changes that were missing so far to unbreak compilation with g++11.
And for the memory leak I sent in a fix upstream for the 6.2 branch too, but it does not apply to 5.15, so I'm sending in the fix for that here directly.
Edited by Milian Wolff