MB-945{6,8}: trim and validate group name for length

Change-Id: Icd118dd30d4ec6c457229c73c87fb490bd84bcfa
Reviewed-on: http://review.couchbase.org/30062
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>