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.