Work around a bug in clang
Under some circumstances, the take() method of QScopedPointer
seems to cause a crash on macOS, probably because of an issue
in the compiler? It's the only place where we use clang.
BUG:413444
(cherry picked from commit 959e4e355f685b3e68266d1263a7f8bd24c7f800)