[processing] more robust layer sorting in multiple selection widget (fixes #11429)