Check if workspace is in group before attempting to add it.

Refs #10116.