Fix traceback when nodegroups are empty

This fixes #5500 by reverting the nodegroups dict in the master config
to its default value when 'nodegroups:' is uncommented in the master
config and there are no nodegroups configured.
Merge pull request #5501 from terminalmage/issue5500

Fix traceback when nodegroups are empty