COOK-3282: Utilize the host_name_attribute when writing out hostgroups from nagios_hostgroups

A small bug: when integrating search-defined hostgroups with a custom host_name_attribute, it causes Nagios to be unable to parse the configuration.