MB-9716: Check if groupname is valid or not

Change-Id: I3a492ab318a4f7e33bc291783bfc03bfc2c1ebb3
Reviewed-on: http://review.couchbase.org/31009
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Bin Cui <bin.cui@gmail.com>