re #8970 Check ws belongs to group before inserting it

This get rids of warning message in SANS reduction due to inserting
workspace to a group which already had that workspace.
Merge remote-tracking branch 'origin/feature/9032_warning_msg'