Fix range-loop detach in containers: non-trivial case
A range-for loop over non-const COW Qt containers can cause a detach.
The code in question first iterates over info.inUseIds list, and then
unconditionally clears the list after the loop.
Rewrite it to first take the current list from the struct (as a const
object) and then iterate over it.
Axivion-Id: qt_Add-ons_qtpositioning_dev_linux:SV207
Task-number: QTBUG-144769
Pick-to: 6.11 6.10 6.8 6.5
Change-Id: Ic0a609a10e606462cb61d03f356a758113077e77
Reviewed-by: Marc Mutz <marc.mutz@qt.io>