prevent node['os'] when nil to be added to hostgroups; happened with chef-zero and not fully bootsraped nodes

Nodes created with chef-zero will not have the 'os' attribute on the first run when returned in the search results. This will just prevent to add the string nil to the list of hostgroups in this case.