Fix a crash in wrap-around mode
Thanks Bernhard Liebl for tracking this problem down
(this patch differs a bit from the one proposed by Bernhard:
it uses double-stage locking for the strategy creation instead
of plain mutex locking)
Differential Revision: https://phabricator.kde.org/D8675