c++: Tweaks for -Wredundant-move [PR107363]