Issue #3346953 by alexpott, acbramley, GoZ, larowlan, bircher: Role permissions are not sorted when saving via admin/people/permissions (cherry picked from commit f965e400)