Check groupnames for None as well as an empty string in add_host

Fixes #7585