qtscript: Change group insertions to remove existing group membership
instead of ignoring insertion if already member of a group, to make it
work the same way as in 3.1. This closes ticket:3902.